
// -*-c++-*-
//-------------------------------------------------------------------------
//   Copyright 2002-2023 National Technology & Engineering Solutions of
//   Sandia, LLC (NTESS).  Under the terms of Contract DE-NA0003525 with
//   NTESS, the U.S. Government retains certain rights in this software.
//
//   This file is part of the Xyce(TM) Parallel Electrical Simulator.
//
//   Xyce(TM) is free software: you can redistribute it and/or modify
//   it under the terms of the GNU General Public License as published by
//   the Free Software Foundation, either version 3 of the License, or
//   (at your option) any later version.
//
//   Xyce(TM) is distributed in the hope that it will be useful,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//   GNU General Public License for more details.
//
//   You should have received a copy of the GNU General Public License
//   along with Xyce(TM).
//   If not, see <http://www.gnu.org/licenses/>.
//-------------------------------------------------------------------------

//-----------------------------------------------------------------------------
//
// Purpose        :
//
// Special Notes  : Generated from verilog file L_UTSOI_102.va with ADMS
//                  interface for Xyce 7.7.0
//                  DO NOT EDIT THIS FILE DIRECTLY!  It may be overwritten!
//
// Creator        : admsXml-2.3.7
//
// Creation Date  : Mon, 09 Jan 2023 12:53:25
//
//-----------------------------------------------------------------------------
#ifndef Xyce_N_DEV_ADMSl_utsoi_h
#define Xyce_N_DEV_ADMSl_utsoi_h


#include <N_DEV_Configuration.h>
#include <N_DEV_Const.h>
#include <N_DEV_DeviceBlock.h>
#include <N_DEV_DeviceInstance.h>
#include <N_DEV_DeviceModel.h>
#include <N_DEV_MOSFET1.h>


// Xyce_config.h contains a VERSION macro from autoconf, and some
// Verilog-A models like to define a variable of that name.  This can be
// a serious problem, and we don't need the VERSION macro.  Get rid of it.
// This must happen *after* all the includes of Xyce headers, each of which
// includes Xyce_config.h.  The implementation file must do this all again
// because it includes more Xyce headers *after* including this one.
#ifdef VERSION
#undef VERSION
#endif

namespace Xyce {
namespace Device {
namespace ADMSl_utsoi {

class Model;
class Instance;
class InstanceSensitivity;

#ifdef Xyce_ADMS_SENSITIVITIES
//-----------------------------------------------------------------------------
// Class         : InstanceSensitivity
//
// Purpose       : This class is a functor for sensitivity
//
// Special Notes :
// Creator       :
// Creation Date :
//-----------------------------------------------------------------------------
class InstanceSensitivity : public baseSensitivity
{
public:
InstanceSensitivity() :
baseSensitivity() {};

virtual ~InstanceSensitivity() {};

virtual void operator()(
const ParameterBase &entity,
const std::string &param,
std::vector<double> & dfdp,
std::vector<double> & dqdp,
std::vector<double> & dbdp,
std::vector<int> & Findices,
std::vector<int> & Qindices,
std::vector<int> & Bindices
) const ;
};

static InstanceSensitivity instSens;


//-----------------------------------------------------------------------------
// Class         : ModelSensitivity
//
// Purpose       : This class is a functor for sensitivity
//
// Special Notes :
// Creator       :
// Creation Date :
//-----------------------------------------------------------------------------
class ModelSensitivity : public baseSensitivity
{
public:
ModelSensitivity() :
baseSensitivity() {};

virtual ~ModelSensitivity() {};

virtual void operator()(
const ParameterBase &entity,
const std::string &param,
std::vector<double> & dfdp,
std::vector<double> & dqdp,
std::vector<double> & dbdp,
std::vector<int> & Findices,
std::vector<int> & Qindices,
std::vector<int> & Bindices
) const ;
};

static ModelSensitivity modSens;
#endif // Xyce_ADMS_SENSITIVITIES

// general purpose free functions
// thermal voltage at kelvin temperature temp)
static inline double adms_vt(const double temp) {return(CONSTKoverQ*temp);};


#ifdef Xyce_ADMS_SENSITIVITIES
//-----------------------------------------------------------------------------
// "structs" to hold instance and model param/variable copies
//-----------------------------------------------------------------------------
class instanceSensStruct
{
public:
// instance parameters
// reals
double instancePar_L;
double d_instancePar_L_dX;
bool instancePar_given_L;
double instancePar_W;
double d_instancePar_W_dX;
bool instancePar_given_W;
double instancePar_ASOURCE;
double d_instancePar_ASOURCE_dX;
bool instancePar_given_ASOURCE;
double instancePar_ADRAIN;
double d_instancePar_ADRAIN_dX;
bool instancePar_given_ADRAIN;
double instancePar_PSOURCE;
double d_instancePar_PSOURCE_dX;
bool instancePar_given_PSOURCE;
double instancePar_PDRAIN;
double d_instancePar_PDRAIN_dX;
bool instancePar_given_PDRAIN;
double instancePar_SA;
double d_instancePar_SA_dX;
bool instancePar_given_SA;
double instancePar_SB;
double d_instancePar_SB_dX;
bool instancePar_given_SB;
double instancePar_SD;
double d_instancePar_SD_dX;
bool instancePar_given_SD;
double instancePar_DELVTO;
double d_instancePar_DELVTO_dX;
bool instancePar_given_DELVTO;
double instancePar_FACTUO;
double d_instancePar_FACTUO_dX;
bool instancePar_given_FACTUO;
// non-reals(including hidden)
int instancePar_NF;
bool instancePar_given_NF;
int instancePar_MULT;
bool instancePar_given_MULT;
int instancePar_M;
bool instancePar_given_M;
// instance variables
// reals
double instanceVar_ASOURCE_i;
double d_instanceVar_ASOURCE_i_dX;
double instanceVar_ADRAIN_i;
double d_instanceVar_ADRAIN_i_dX;
double instanceVar_PSOURCE_i;
double d_instanceVar_PSOURCE_i_dX;
double instanceVar_PDRAIN_i;
double d_instanceVar_PDRAIN_i_dX;
double instanceVar_MULT_i;
double d_instanceVar_MULT_i_dX;
double instanceVar_VFB1_i;
double d_instanceVar_VFB1_i_dX;
double instanceVar_CIC1_i;
double d_instanceVar_CIC1_i_dX;
double instanceVar_PSCE1_i;
double d_instanceVar_PSCE1_i_dX;
double instanceVar_CF1_i;
double d_instanceVar_CF1_i_dX;
double instanceVar_BETN1_i;
double d_instanceVar_BETN1_i_dX;
double instanceVar_THESAT1_i;
double d_instanceVar_THESAT1_i_dX;
double instanceVar_VFB2_i;
double d_instanceVar_VFB2_i_dX;
double instanceVar_CIC2_i;
double d_instanceVar_CIC2_i_dX;
double instanceVar_PSCE2_i;
double d_instanceVar_PSCE2_i_dX;
double instanceVar_CF2_i;
double d_instanceVar_CF2_i_dX;
double instanceVar_BETN2_i;
double d_instanceVar_BETN2_i_dX;
double instanceVar_THESAT2_i;
double d_instanceVar_THESAT2_i_dX;
double instanceVar_TSI_i;
double d_instanceVar_TSI_i_dX;
double instanceVar_XGE_i;
double d_instanceVar_XGE_i_dX;
double instanceVar_TYPESUB_i;
double instanceVar_NOV_i;
double d_instanceVar_NOV_i_dX;
double instanceVar_NOVD_i;
double d_instanceVar_NOVD_i_dX;
double instanceVar_STVFB_i;
double d_instanceVar_STVFB_i_dX;
double instanceVar_NSDDC_i;
double d_instanceVar_NSDDC_i_dX;
double instanceVar_PSCEDLB_i;
double d_instanceVar_PSCEDLB_i_dX;
double instanceVar_STCF_i;
double d_instanceVar_STCF_i_dX;
double instanceVar_CFD_i;
double d_instanceVar_CFD_i_dX;
double instanceVar_CFDL_i;
double d_instanceVar_CFDL_i_dX;
double instanceVar_CFDLB_i;
double d_instanceVar_CFDLB_i_dX;
double instanceVar_STBET_i;
double d_instanceVar_STBET_i_dX;
double instanceVar_MUE_i;
double d_instanceVar_MUE_i_dX;
double instanceVar_STMUE_i;
double d_instanceVar_STMUE_i_dX;
double instanceVar_THEMU_i;
double d_instanceVar_THEMU_i_dX;
double instanceVar_STTHEMU_i;
double d_instanceVar_STTHEMU_i_dX;
double instanceVar_CS_i;
double d_instanceVar_CS_i_dX;
double instanceVar_CSFI_i;
double d_instanceVar_CSFI_i_dX;
double instanceVar_CSBI_i;
double d_instanceVar_CSBI_i_dX;
double instanceVar_STCS_i;
double d_instanceVar_STCS_i_dX;
double instanceVar_THECS_i;
double d_instanceVar_THECS_i_dX;
double instanceVar_STTHECS_i;
double d_instanceVar_STTHECS_i_dX;
double instanceVar_STXCOR_i;
double d_instanceVar_STXCOR_i_dX;
double instanceVar_RS_i;
double d_instanceVar_RS_i_dX;
double instanceVar_RSIG_i;
double d_instanceVar_RSIG_i_dX;
double instanceVar_STRS_i;
double d_instanceVar_STRS_i_dX;
double instanceVar_RSG_i;
double d_instanceVar_RSG_i_dX;
double instanceVar_THERSG_i;
double d_instanceVar_THERSG_i_dX;
double instanceVar_RSB_i;
double d_instanceVar_RSB_i_dX;
double instanceVar_CT_i;
double d_instanceVar_CT_i_dX;
double instanceVar_TOXP_i;
double d_instanceVar_TOXP_i_dX;
double instanceVar_XCOR_i;
double d_instanceVar_XCOR_i_dX;
double instanceVar_XCORB_i;
double d_instanceVar_XCORB_i_dX;
double instanceVar_THESAT_i;
double d_instanceVar_THESAT_i_dX;
double instanceVar_STTHESAT_i;
double d_instanceVar_STTHESAT_i_dX;
double instanceVar_ALP_i;
double d_instanceVar_ALP_i_dX;
double instanceVar_ALP1_i;
double d_instanceVar_ALP1_i_dX;
double instanceVar_ALPB_i;
double d_instanceVar_ALPB_i_dX;
double instanceVar_VP_i;
double d_instanceVar_VP_i_dX;
double instanceVar_VPG_i;
double d_instanceVar_VPG_i_dX;
double instanceVar_GCO_i;
double d_instanceVar_GCO_i_dX;
double instanceVar_IGINV_i;
double d_instanceVar_IGINV_i_dX;
double instanceVar_IGOVINV_i;
double d_instanceVar_IGOVINV_i_dX;
double instanceVar_IGOVINVD_i;
double d_instanceVar_IGOVINVD_i_dX;
double instanceVar_IGOVACC_i;
double d_instanceVar_IGOVACC_i_dX;
double instanceVar_IGOVACCD_i;
double d_instanceVar_IGOVACCD_i_dX;
double instanceVar_STIG_i;
double d_instanceVar_STIG_i_dX;
double instanceVar_STIGFN_i;
double d_instanceVar_STIGFN_i_dX;
double instanceVar_FNOVINV_i;
double d_instanceVar_FNOVINV_i_dX;
double instanceVar_FNOVINVD_i;
double d_instanceVar_FNOVINVD_i_dX;
double instanceVar_GC2CH_i;
double d_instanceVar_GC2CH_i_dX;
double instanceVar_GC3CH_i;
double d_instanceVar_GC3CH_i_dX;
double instanceVar_GC2OVINV_i;
double d_instanceVar_GC2OVINV_i_dX;
double instanceVar_GC3OVINV_i;
double d_instanceVar_GC3OVINV_i_dX;
double instanceVar_GC2OVACC_i;
double d_instanceVar_GC2OVACC_i_dX;
double instanceVar_GC3OVACC_i;
double d_instanceVar_GC3OVACC_i_dX;
double instanceVar_GCDOV_i;
double d_instanceVar_GCDOV_i_dX;
double instanceVar_GCVDOV_i;
double d_instanceVar_GCVDOV_i_dX;
double instanceVar_CHIB_i;
double d_instanceVar_CHIB_i_dX;
double instanceVar_NIGINV_i;
double d_instanceVar_NIGINV_i_dX;
double instanceVar_GCOVINVFN_i;
double d_instanceVar_GCOVINVFN_i_dX;
double instanceVar_AGIDL_i;
double d_instanceVar_AGIDL_i_dX;
double instanceVar_AGIDLD_i;
double d_instanceVar_AGIDLD_i_dX;
double instanceVar_BGIDL_i;
double d_instanceVar_BGIDL_i_dX;
double instanceVar_BGIDLD_i;
double d_instanceVar_BGIDLD_i_dX;
double instanceVar_STBGIDL_i;
double d_instanceVar_STBGIDL_i_dX;
double instanceVar_STBGIDLD_i;
double d_instanceVar_STBGIDLD_i_dX;
double instanceVar_CGIDL_i;
double d_instanceVar_CGIDL_i_dX;
double instanceVar_CGIDLD_i;
double d_instanceVar_CGIDLD_i_dX;
double instanceVar_DGIDL_i;
double d_instanceVar_DGIDL_i_dX;
double instanceVar_DGIDLD_i;
double d_instanceVar_DGIDLD_i_dX;
double instanceVar_A1_i;
double d_instanceVar_A1_i_dX;
double instanceVar_A2_i;
double d_instanceVar_A2_i_dX;
double instanceVar_STA2_i;
double d_instanceVar_STA2_i_dX;
double instanceVar_A3_i;
double d_instanceVar_A3_i_dX;
double instanceVar_AREAQ_i;
double d_instanceVar_AREAQ_i_dX;
double instanceVar_CGBOV_i;
double d_instanceVar_CGBOV_i_dX;
double instanceVar_NSDAC_i;
double d_instanceVar_NSDAC_i_dX;
double instanceVar_FIF_i;
double d_instanceVar_FIF_i_dX;
double instanceVar_FSCEAC_i;
double d_instanceVar_FSCEAC_i_dX;
double instanceVar_COV_i;
double d_instanceVar_COV_i_dX;
double instanceVar_COVD_i;
double d_instanceVar_COVD_i_dX;
double instanceVar_COVDL_i;
double d_instanceVar_COVDL_i_dX;
double instanceVar_COVDLB_i;
double d_instanceVar_COVDLB_i_dX;
double instanceVar_DVFBOV_i;
double d_instanceVar_DVFBOV_i_dX;
double instanceVar_CFR_i;
double d_instanceVar_CFR_i_dX;
double instanceVar_CFRD_i;
double d_instanceVar_CFRD_i_dX;
double instanceVar_CSD_i;
double d_instanceVar_CSD_i_dX;
double instanceVar_CSDBP_i;
double d_instanceVar_CSDBP_i_dX;
double instanceVar_RTH_i;
double d_instanceVar_RTH_i_dX;
double instanceVar_STRTH_i;
double d_instanceVar_STRTH_i_dX;
double instanceVar_CTH_i;
double d_instanceVar_CTH_i_dX;
double instanceVar_FNT_i;
double d_instanceVar_FNT_i_dX;
double instanceVar_FNTEXC_i;
double d_instanceVar_FNTEXC_i_dX;
double instanceVar_NFA_i;
double d_instanceVar_NFA_i_dX;
double instanceVar_NFB_i;
double d_instanceVar_NFB_i_dX;
double instanceVar_NFC_i;
double d_instanceVar_NFC_i_dX;
double instanceVar_NFE_i;
double d_instanceVar_NFE_i_dX;
double instanceVar_NFEB_i;
double d_instanceVar_NFEB_i_dX;
double instanceVar_EF_i;
double d_instanceVar_EF_i_dX;
double instanceVar_VFB1_t;
double d_instanceVar_VFB1_t_dX;
double instanceVar_CF1_t;
double d_instanceVar_CF1_t_dX;
double instanceVar_BETN1_t;
double d_instanceVar_BETN1_t_dX;
double instanceVar_VFB2_t;
double d_instanceVar_VFB2_t_dX;
double instanceVar_CF2_t;
double d_instanceVar_CF2_t_dX;
double instanceVar_BETN2_t;
double d_instanceVar_BETN2_t_dX;
double instanceVar_MUE_t;
double d_instanceVar_MUE_t_dX;
double instanceVar_THEMU_t;
double d_instanceVar_THEMU_t_dX;
double instanceVar_CS_t;
double d_instanceVar_CS_t_dX;
double instanceVar_THECS_t;
double d_instanceVar_THECS_t_dX;
double instanceVar_RS_t;
double d_instanceVar_RS_t_dX;
double instanceVar_XCOR_t;
double d_instanceVar_XCOR_t_dX;
double instanceVar_THESAT_t;
double d_instanceVar_THESAT_t_dX;
double instanceVar_IGINV_t;
double d_instanceVar_IGINV_t_dX;
double instanceVar_IGOVINV_t;
double d_instanceVar_IGOVINV_t_dX;
double instanceVar_IGOVINVD_t;
double d_instanceVar_IGOVINVD_t_dX;
double instanceVar_IGOVACC_t;
double d_instanceVar_IGOVACC_t_dX;
double instanceVar_IGOVACCD_t;
double d_instanceVar_IGOVACCD_t_dX;
double instanceVar_FNOVINV_t;
double d_instanceVar_FNOVINV_t_dX;
double instanceVar_FNOVINVD_t;
double d_instanceVar_FNOVINVD_t_dX;
double instanceVar_BGIDL_t;
double d_instanceVar_BGIDL_t_dX;
double instanceVar_BGIDLD_t;
double d_instanceVar_BGIDLD_t_dX;
double instanceVar_A2_t;
double d_instanceVar_A2_t_dX;
double instanceVar_RTH_t;
double d_instanceVar_RTH_t_dX;
double instanceVar_gamAX;
double d_instanceVar_gamAX_dX;
double instanceVar_temp;
double d_instanceVar_temp_dX;
double instanceVar_temp1;
double d_instanceVar_temp1_dX;
double instanceVar_temp2;
double d_instanceVar_temp2_dX;
double instanceVar_temp3;
double d_instanceVar_temp3_dX;
double instanceVar_temp4;
double d_instanceVar_temp4_dX;
double instanceVar_TKC;
double instanceVar_TKC_sq;
double instanceVar_DTC;
double instanceVar_dT;
double d_instanceVar_dT_dX;
double instanceVar_rT;
double d_instanceVar_rT_dX;
double instanceVar_rTn;
double d_instanceVar_rTn_dX;
double instanceVar_phit0;
double instanceVar_inv_phit0;
double instanceVar_phit;
double d_instanceVar_phit_dX;
double instanceVar_inv_phit;
double d_instanceVar_inv_phit_dX;
double instanceVar_one_m_xge;
double d_instanceVar_one_m_xge_dX;
double instanceVar_epsch;
double d_instanceVar_epsch_dX;
double instanceVar_EgSi;
double instanceVar_EgGe;
double instanceVar_dEg;
double d_instanceVar_dEg_dX;
double instanceVar_Eg;
double d_instanceVar_Eg_dX;
double instanceVar_Eg_2phit0;
double d_instanceVar_Eg_2phit0_dX;
double instanceVar_Eg_2phit;
double d_instanceVar_Eg_2phit_dX;
double instanceVar_dVfbch;
double d_instanceVar_dVfbch_dX;
double instanceVar_niratio;
double d_instanceVar_niratio_dX;
double instanceVar_Cox2Init;
double d_instanceVar_Cox2Init_dX;
double instanceVar_Cox1Prime;
double d_instanceVar_Cox1Prime_dX;
double instanceVar_Cox2Prime;
double d_instanceVar_Cox2Prime_dX;
double instanceVar_dVfb1Nch;
double d_instanceVar_dVfb1Nch_dX;
double instanceVar_dVfb2Nch;
double d_instanceVar_dVfb2Nch_dX;
double instanceVar_CsiPrime_0;
double d_instanceVar_CsiPrime_0_dX;
double instanceVar_k1_1D;
double d_instanceVar_k1_1D_dX;
double instanceVar_k2_1D;
double d_instanceVar_k2_1D_dX;
double instanceVar_keq_1D;
double d_instanceVar_keq_1D_dX;
double instanceVar_neff;
double d_instanceVar_neff_dX;
double instanceVar_A0_Csisq;
double d_instanceVar_A0_Csisq_dX;
double instanceVar_xth_1D;
double d_instanceVar_xth_1D_dX;
double instanceVar_xSDdep;
double d_instanceVar_xSDdep_dX;
double instanceVar_dVfbQM;
double d_instanceVar_dVfbQM_dX;
double instanceVar_qq;
double d_instanceVar_qq_dX;
double instanceVar_tsisq;
double d_instanceVar_tsisq_dX;
double instanceVar_Gfsub;
double d_instanceVar_Gfsub_dX;
double instanceVar_Gfsub2;
double d_instanceVar_Gfsub2_dX;
double instanceVar_inv_Gfsub2;
double d_instanceVar_inv_Gfsub2_dX;
double instanceVar_xisub;
double d_instanceVar_xisub_dX;
double instanceVar_inv_xisub;
double d_instanceVar_inv_xisub_dX;
double instanceVar_margin_sub;
double d_instanceVar_margin_sub_dX;
double instanceVar_xn_sub;
double d_instanceVar_xn_sub_dX;
double instanceVar_fmue;
double d_instanceVar_fmue_dX;
double instanceVar_inv_qi1cs;
double d_instanceVar_inv_qi1cs_dX;
double instanceVar_inv_qi2cs;
double d_instanceVar_inv_qi2cs_dX;
double instanceVar_eta_mu;
double d_instanceVar_eta_mu_dX;
double instanceVar_one_m_eta;
double d_instanceVar_one_m_eta_dX;
double instanceVar_frs;
double d_instanceVar_frs_dX;
double instanceVar_sat_phit;
double d_instanceVar_sat_phit_dX;
double instanceVar_alp1_phit;
double d_instanceVar_alp1_phit_dX;
double instanceVar_inv_CHIB;
double d_instanceVar_inv_CHIB_dX;
double instanceVar_tempM;
double d_instanceVar_tempM_dX;
double instanceVar_BCH;
double d_instanceVar_BCH_dX;
double instanceVar_BOV;
double d_instanceVar_BOV_dX;
double instanceVar_GCQCH;
double d_instanceVar_GCQCH_dX;
double instanceVar_GCQOVINV;
double d_instanceVar_GCQOVINV_dX;
double instanceVar_GCQOVACC;
double d_instanceVar_GCQOVACC_dX;
double instanceVar_alpha_b;
double d_instanceVar_alpha_b_dX;
double instanceVar_Dch;
double d_instanceVar_Dch_dX;
double instanceVar_Dov;
double d_instanceVar_Dov_dX;
double instanceVar_n_iginv;
double d_instanceVar_n_iginv_dX;
double instanceVar_area_phit;
double d_instanceVar_area_phit_dX;
double instanceVar_inner_sd;
double d_instanceVar_inner_sd_dX;
double instanceVar_xsd;
double d_instanceVar_xsd_dX;
double instanceVar_fif_phit;
double d_instanceVar_fif_phit_dX;
double instanceVar_lambda2D;
double d_instanceVar_lambda2D_dX;
double instanceVar_lnrTn;
double d_instanceVar_lnrTn_dX;
double instanceVar_tf_bet;
double d_instanceVar_tf_bet_dX;
double instanceVar_tf_mue;
double d_instanceVar_tf_mue_dX;
double instanceVar_tf_themu;
double d_instanceVar_tf_themu_dX;
double instanceVar_tf_cs;
double d_instanceVar_tf_cs_dX;
double instanceVar_tf_thecs;
double d_instanceVar_tf_thecs_dX;
double instanceVar_tf_xcor;
double d_instanceVar_tf_xcor_dX;
double instanceVar_tf_ther;
double d_instanceVar_tf_ther_dX;
double instanceVar_tf_thesat;
double d_instanceVar_tf_thesat_dX;
double instanceVar_tf_ig;
double d_instanceVar_tf_ig_dX;
double instanceVar_tf_rth;
double d_instanceVar_tf_rth_dX;
double instanceVar_nt;
double d_instanceVar_nt_dX;
double instanceVar_nt0;
double d_instanceVar_nt0_dX;
double instanceVar_fac_exc;
double d_instanceVar_fac_exc_dX;
double instanceVar_sigVds;
double instanceVar_CsiPrime;
double d_instanceVar_CsiPrime_dX;
double instanceVar_xd0;
double d_instanceVar_xd0_dX;
double instanceVar_k1;
double d_instanceVar_k1_dX;
double instanceVar_qis;
double d_instanceVar_qis_dX;
double instanceVar_ds;
double d_instanceVar_ds_dX;
double instanceVar_qid;
double d_instanceVar_qid_dX;
double instanceVar_dd;
double d_instanceVar_dd_dX;
double instanceVar_esurf1;
double d_instanceVar_esurf1_dX;
double instanceVar_qmfact1;
double d_instanceVar_qmfact1_dX;
double instanceVar_esurf2;
double d_instanceVar_esurf2_dX;
double instanceVar_betneff;
double d_instanceVar_betneff_dX;
double instanceVar_xdeff;
double d_instanceVar_xdeff_dX;
double instanceVar_qim;
double d_instanceVar_qim_dX;
double instanceVar_Gmob;
double d_instanceVar_Gmob_dX;
double instanceVar_FdL;
double d_instanceVar_FdL_dX;
double instanceVar_Ggamma;
double d_instanceVar_Ggamma_dX;
double instanceVar_zsat;
double d_instanceVar_zsat_dX;
double instanceVar_hsat;
double d_instanceVar_hsat_dX;
double instanceVar_Gvsat;
double d_instanceVar_Gvsat_dX;
double instanceVar_qmfact;
double d_instanceVar_qmfact_dX;
double instanceVar_fact_Ids;
double d_instanceVar_fact_Ids_dX;
double instanceVar_Ids;
double d_instanceVar_Ids_dX;
double instanceVar_delta_k1q1;
double d_instanceVar_delta_k1q1_dX;
double instanceVar_inv_k1h1_0;
double d_instanceVar_inv_k1h1_0_dX;
double instanceVar_Igse;
double d_instanceVar_Igse_dX;
double instanceVar_Igde;
double d_instanceVar_Igde_dX;
double instanceVar_Igidle;
double d_instanceVar_Igidle_dX;
double instanceVar_Igisle;
double d_instanceVar_Igisle_dX;
double instanceVar_mavl;
double d_instanceVar_mavl_dX;
double instanceVar_Iimpact;
double d_instanceVar_Iimpact_dX;
};

class modelSensStruct
{
public:
// model parameters
// reals
double modelPar_VERSION;
double d_modelPar_VERSION_dX;
bool modelPar_given_VERSION;
double modelPar_QMC;
double d_modelPar_QMC_dX;
bool modelPar_given_QMC;
double modelPar_TR;
double d_modelPar_TR_dX;
bool modelPar_given_TR;
double modelPar_TMAX;
double d_modelPar_TMAX_dX;
bool modelPar_given_TMAX;
double modelPar_TOXE;
double d_modelPar_TOXE_dX;
bool modelPar_given_TOXE;
double modelPar_TSI;
double d_modelPar_TSI_dX;
bool modelPar_given_TSI;
double modelPar_XGE;
double d_modelPar_XGE_dX;
bool modelPar_given_XGE;
double modelPar_TBOX;
double d_modelPar_TBOX_dX;
bool modelPar_given_TBOX;
double modelPar_NCH;
double d_modelPar_NCH_dX;
bool modelPar_given_NCH;
double modelPar_NSUB;
double d_modelPar_NSUB_dX;
bool modelPar_given_NSUB;
double modelPar_CT;
double d_modelPar_CT_dX;
bool modelPar_given_CT;
double modelPar_TOXP;
double d_modelPar_TOXP_dX;
bool modelPar_given_TOXP;
double modelPar_NOV;
double d_modelPar_NOV_dX;
bool modelPar_given_NOV;
double modelPar_NOVD;
double d_modelPar_NOVD_dX;
bool modelPar_given_NOVD;
double modelPar_VFB;
double d_modelPar_VFB_dX;
bool modelPar_given_VFB;
double modelPar_VFBB;
double d_modelPar_VFBB_dX;
bool modelPar_given_VFBB;
double modelPar_STVFB;
double d_modelPar_STVFB_dX;
bool modelPar_given_STVFB;
double modelPar_CICF;
double d_modelPar_CICF_dX;
bool modelPar_given_CICF;
double modelPar_CIC;
double d_modelPar_CIC_dX;
bool modelPar_given_CIC;
double modelPar_PSCE;
double d_modelPar_PSCE_dX;
bool modelPar_given_PSCE;
double modelPar_PSCEB;
double d_modelPar_PSCEB_dX;
bool modelPar_given_PSCEB;
double modelPar_NSDDC;
double d_modelPar_NSDDC_dX;
bool modelPar_given_NSDDC;
double modelPar_PSCEDLB;
double d_modelPar_PSCEDLB_dX;
bool modelPar_given_PSCEDLB;
double modelPar_PNCE;
double d_modelPar_PNCE_dX;
bool modelPar_given_PNCE;
double modelPar_CF;
double d_modelPar_CF_dX;
bool modelPar_given_CF;
double modelPar_CFB;
double d_modelPar_CFB_dX;
bool modelPar_given_CFB;
double modelPar_STCF;
double d_modelPar_STCF_dX;
bool modelPar_given_STCF;
double modelPar_CFD;
double d_modelPar_CFD_dX;
bool modelPar_given_CFD;
double modelPar_CFDL;
double d_modelPar_CFDL_dX;
bool modelPar_given_CFDL;
double modelPar_CFDLB;
double d_modelPar_CFDLB_dX;
bool modelPar_given_CFDLB;
double modelPar_BETN;
double d_modelPar_BETN_dX;
bool modelPar_given_BETN;
double modelPar_BETNB;
double d_modelPar_BETNB_dX;
bool modelPar_given_BETNB;
double modelPar_STBET;
double d_modelPar_STBET_dX;
bool modelPar_given_STBET;
double modelPar_CS;
double d_modelPar_CS_dX;
bool modelPar_given_CS;
double modelPar_CSFI;
double d_modelPar_CSFI_dX;
bool modelPar_given_CSFI;
double modelPar_CSBI;
double d_modelPar_CSBI_dX;
bool modelPar_given_CSBI;
double modelPar_STCS;
double d_modelPar_STCS_dX;
bool modelPar_given_STCS;
double modelPar_THECS;
double d_modelPar_THECS_dX;
bool modelPar_given_THECS;
double modelPar_STTHECS;
double d_modelPar_STTHECS_dX;
bool modelPar_given_STTHECS;
double modelPar_CSTHR;
double d_modelPar_CSTHR_dX;
bool modelPar_given_CSTHR;
double modelPar_CSTHRB;
double d_modelPar_CSTHRB_dX;
bool modelPar_given_CSTHRB;
double modelPar_MUE;
double d_modelPar_MUE_dX;
bool modelPar_given_MUE;
double modelPar_STMUE;
double d_modelPar_STMUE_dX;
bool modelPar_given_STMUE;
double modelPar_THEMU;
double d_modelPar_THEMU_dX;
bool modelPar_given_THEMU;
double modelPar_STTHEMU;
double d_modelPar_STTHEMU_dX;
bool modelPar_given_STTHEMU;
double modelPar_XCOR;
double d_modelPar_XCOR_dX;
bool modelPar_given_XCOR;
double modelPar_XCORB;
double d_modelPar_XCORB_dX;
bool modelPar_given_XCORB;
double modelPar_STXCOR;
double d_modelPar_STXCOR_dX;
bool modelPar_given_STXCOR;
double modelPar_FETA;
double d_modelPar_FETA_dX;
bool modelPar_given_FETA;
double modelPar_RS;
double d_modelPar_RS_dX;
bool modelPar_given_RS;
double modelPar_RSIG;
double d_modelPar_RSIG_dX;
bool modelPar_given_RSIG;
double modelPar_STRS;
double d_modelPar_STRS_dX;
bool modelPar_given_STRS;
double modelPar_RSG;
double d_modelPar_RSG_dX;
bool modelPar_given_RSG;
double modelPar_THERSG;
double d_modelPar_THERSG_dX;
bool modelPar_given_THERSG;
double modelPar_RSB;
double d_modelPar_RSB_dX;
bool modelPar_given_RSB;
double modelPar_THESAT;
double d_modelPar_THESAT_dX;
bool modelPar_given_THESAT;
double modelPar_STTHESAT;
double d_modelPar_STTHESAT_dX;
bool modelPar_given_STTHESAT;
double modelPar_THESATG;
double d_modelPar_THESATG_dX;
bool modelPar_given_THESATG;
double modelPar_THESATB;
double d_modelPar_THESATB_dX;
bool modelPar_given_THESATB;
double modelPar_AX;
double d_modelPar_AX_dX;
bool modelPar_given_AX;
double modelPar_ALP;
double d_modelPar_ALP_dX;
bool modelPar_given_ALP;
double modelPar_ALP1;
double d_modelPar_ALP1_dX;
bool modelPar_given_ALP1;
double modelPar_ALPB;
double d_modelPar_ALPB_dX;
bool modelPar_given_ALPB;
double modelPar_VP;
double d_modelPar_VP_dX;
bool modelPar_given_VP;
double modelPar_VPG;
double d_modelPar_VPG_dX;
bool modelPar_given_VPG;
double modelPar_GCO;
double d_modelPar_GCO_dX;
bool modelPar_given_GCO;
double modelPar_IGINV;
double d_modelPar_IGINV_dX;
bool modelPar_given_IGINV;
double modelPar_IGOVINV;
double d_modelPar_IGOVINV_dX;
bool modelPar_given_IGOVINV;
double modelPar_IGOVINVD;
double d_modelPar_IGOVINVD_dX;
bool modelPar_given_IGOVINVD;
double modelPar_IGOVACC;
double d_modelPar_IGOVACC_dX;
bool modelPar_given_IGOVACC;
double modelPar_IGOVACCD;
double d_modelPar_IGOVACCD_dX;
bool modelPar_given_IGOVACCD;
double modelPar_STIG;
double d_modelPar_STIG_dX;
bool modelPar_given_STIG;
double modelPar_GC2CH;
double d_modelPar_GC2CH_dX;
bool modelPar_given_GC2CH;
double modelPar_GC3CH;
double d_modelPar_GC3CH_dX;
bool modelPar_given_GC3CH;
double modelPar_GC2OVINV;
double d_modelPar_GC2OVINV_dX;
bool modelPar_given_GC2OVINV;
double modelPar_GC3OVINV;
double d_modelPar_GC3OVINV_dX;
bool modelPar_given_GC3OVINV;
double modelPar_GC2OVACC;
double d_modelPar_GC2OVACC_dX;
bool modelPar_given_GC2OVACC;
double modelPar_GC3OVACC;
double d_modelPar_GC3OVACC_dX;
bool modelPar_given_GC3OVACC;
double modelPar_GCDOV;
double d_modelPar_GCDOV_dX;
bool modelPar_given_GCDOV;
double modelPar_GCVDOV;
double d_modelPar_GCVDOV_dX;
bool modelPar_given_GCVDOV;
double modelPar_CHIB;
double d_modelPar_CHIB_dX;
bool modelPar_given_CHIB;
double modelPar_NIGINV;
double d_modelPar_NIGINV_dX;
bool modelPar_given_NIGINV;
double modelPar_FNOVINV;
double d_modelPar_FNOVINV_dX;
bool modelPar_given_FNOVINV;
double modelPar_FNOVINVD;
double d_modelPar_FNOVINVD_dX;
bool modelPar_given_FNOVINVD;
double modelPar_GCOVINVFN;
double d_modelPar_GCOVINVFN_dX;
bool modelPar_given_GCOVINVFN;
double modelPar_STIGFN;
double d_modelPar_STIGFN_dX;
bool modelPar_given_STIGFN;
double modelPar_AGIDL;
double d_modelPar_AGIDL_dX;
bool modelPar_given_AGIDL;
double modelPar_AGIDLD;
double d_modelPar_AGIDLD_dX;
bool modelPar_given_AGIDLD;
double modelPar_BGIDL;
double d_modelPar_BGIDL_dX;
bool modelPar_given_BGIDL;
double modelPar_BGIDLD;
double d_modelPar_BGIDLD_dX;
bool modelPar_given_BGIDLD;
double modelPar_STBGIDL;
double d_modelPar_STBGIDL_dX;
bool modelPar_given_STBGIDL;
double modelPar_STBGIDLD;
double d_modelPar_STBGIDLD_dX;
bool modelPar_given_STBGIDLD;
double modelPar_CGIDL;
double d_modelPar_CGIDL_dX;
bool modelPar_given_CGIDL;
double modelPar_CGIDLD;
double d_modelPar_CGIDLD_dX;
bool modelPar_given_CGIDLD;
double modelPar_DGIDL;
double d_modelPar_DGIDL_dX;
bool modelPar_given_DGIDL;
double modelPar_DGIDLD;
double d_modelPar_DGIDLD_dX;
bool modelPar_given_DGIDLD;
double modelPar_A1;
double d_modelPar_A1_dX;
bool modelPar_given_A1;
double modelPar_A2;
double d_modelPar_A2_dX;
bool modelPar_given_A2;
double modelPar_STA2;
double d_modelPar_STA2_dX;
bool modelPar_given_STA2;
double modelPar_A3;
double d_modelPar_A3_dX;
bool modelPar_given_A3;
double modelPar_AREAQ;
double d_modelPar_AREAQ_dX;
bool modelPar_given_AREAQ;
double modelPar_CGBOV;
double d_modelPar_CGBOV_dX;
bool modelPar_given_CGBOV;
double modelPar_NSDAC;
double d_modelPar_NSDAC_dX;
bool modelPar_given_NSDAC;
double modelPar_FIF;
double d_modelPar_FIF_dX;
bool modelPar_given_FIF;
double modelPar_FSCEAC;
double d_modelPar_FSCEAC_dX;
bool modelPar_given_FSCEAC;
double modelPar_COV;
double d_modelPar_COV_dX;
bool modelPar_given_COV;
double modelPar_COVD;
double d_modelPar_COVD_dX;
bool modelPar_given_COVD;
double modelPar_COVDL;
double d_modelPar_COVDL_dX;
bool modelPar_given_COVDL;
double modelPar_COVDLB;
double d_modelPar_COVDLB_dX;
bool modelPar_given_COVDLB;
double modelPar_DVFBOV;
double d_modelPar_DVFBOV_dX;
bool modelPar_given_DVFBOV;
double modelPar_CFR;
double d_modelPar_CFR_dX;
bool modelPar_given_CFR;
double modelPar_CFRD;
double d_modelPar_CFRD_dX;
bool modelPar_given_CFRD;
double modelPar_CSD;
double d_modelPar_CSD_dX;
bool modelPar_given_CSD;
double modelPar_CSDBP;
double d_modelPar_CSDBP_dX;
bool modelPar_given_CSDBP;
double modelPar_RTH;
double d_modelPar_RTH_dX;
bool modelPar_given_RTH;
double modelPar_STRTH;
double d_modelPar_STRTH_dX;
bool modelPar_given_STRTH;
double modelPar_CTH;
double d_modelPar_CTH_dX;
bool modelPar_given_CTH;
double modelPar_FNT;
double d_modelPar_FNT_dX;
bool modelPar_given_FNT;
double modelPar_FNTEXC;
double d_modelPar_FNTEXC_dX;
bool modelPar_given_FNTEXC;
double modelPar_NFA;
double d_modelPar_NFA_dX;
bool modelPar_given_NFA;
double modelPar_NFB;
double d_modelPar_NFB_dX;
bool modelPar_given_NFB;
double modelPar_NFC;
double d_modelPar_NFC_dX;
bool modelPar_given_NFC;
double modelPar_NFE;
double d_modelPar_NFE_dX;
bool modelPar_given_NFE;
double modelPar_NFEB;
double d_modelPar_NFEB_dX;
bool modelPar_given_NFEB;
double modelPar_EF;
double d_modelPar_EF_dX;
bool modelPar_given_EF;
double modelPar_LVARO;
double d_modelPar_LVARO_dX;
bool modelPar_given_LVARO;
double modelPar_LVARL;
double d_modelPar_LVARL_dX;
bool modelPar_given_LVARL;
double modelPar_LVARW;
double d_modelPar_LVARW_dX;
bool modelPar_given_LVARW;
double modelPar_LAP;
double d_modelPar_LAP_dX;
bool modelPar_given_LAP;
double modelPar_WVARO;
double d_modelPar_WVARO_dX;
bool modelPar_given_WVARO;
double modelPar_WVARL;
double d_modelPar_WVARL_dX;
bool modelPar_given_WVARL;
double modelPar_WVARW;
double d_modelPar_WVARW_dX;
bool modelPar_given_WVARW;
double modelPar_WOT;
double d_modelPar_WOT_dX;
bool modelPar_given_WOT;
double modelPar_DLQ;
double d_modelPar_DLQ_dX;
bool modelPar_given_DLQ;
double modelPar_DWQ;
double d_modelPar_DWQ_dX;
bool modelPar_given_DWQ;
double modelPar_TOXEO;
double d_modelPar_TOXEO_dX;
bool modelPar_given_TOXEO;
double modelPar_TSIO;
double d_modelPar_TSIO_dX;
bool modelPar_given_TSIO;
double modelPar_XGEO;
double d_modelPar_XGEO_dX;
bool modelPar_given_XGEO;
double modelPar_TBOXO;
double d_modelPar_TBOXO_dX;
bool modelPar_given_TBOXO;
double modelPar_NCHO;
double d_modelPar_NCHO_dX;
bool modelPar_given_NCHO;
double modelPar_NSUBO;
double d_modelPar_NSUBO_dX;
bool modelPar_given_NSUBO;
double modelPar_CTO;
double d_modelPar_CTO_dX;
bool modelPar_given_CTO;
double modelPar_TOXPO;
double d_modelPar_TOXPO_dX;
bool modelPar_given_TOXPO;
double modelPar_NOVO;
double d_modelPar_NOVO_dX;
bool modelPar_given_NOVO;
double modelPar_NOVDO;
double d_modelPar_NOVDO_dX;
bool modelPar_given_NOVDO;
double modelPar_VFBO;
double d_modelPar_VFBO_dX;
bool modelPar_given_VFBO;
double modelPar_VFBL;
double d_modelPar_VFBL_dX;
bool modelPar_given_VFBL;
double modelPar_VFBLEXP;
double d_modelPar_VFBLEXP_dX;
bool modelPar_given_VFBLEXP;
double modelPar_VFBL2;
double d_modelPar_VFBL2_dX;
bool modelPar_given_VFBL2;
double modelPar_VFBLEXP2;
double d_modelPar_VFBLEXP2_dX;
bool modelPar_given_VFBLEXP2;
double modelPar_VFBW;
double d_modelPar_VFBW_dX;
bool modelPar_given_VFBW;
double modelPar_VFBLW;
double d_modelPar_VFBLW_dX;
bool modelPar_given_VFBLW;
double modelPar_VFBBO;
double d_modelPar_VFBBO_dX;
bool modelPar_given_VFBBO;
double modelPar_VFBLBO;
double d_modelPar_VFBLBO_dX;
bool modelPar_given_VFBLBO;
double modelPar_STVFBO;
double d_modelPar_STVFBO_dX;
bool modelPar_given_STVFBO;
double modelPar_STVFBL;
double d_modelPar_STVFBL_dX;
bool modelPar_given_STVFBL;
double modelPar_STVFBW;
double d_modelPar_STVFBW_dX;
bool modelPar_given_STVFBW;
double modelPar_STVFBLW;
double d_modelPar_STVFBLW_dX;
bool modelPar_given_STVFBLW;
double modelPar_CICFO;
double d_modelPar_CICFO_dX;
bool modelPar_given_CICFO;
double modelPar_CICO;
double d_modelPar_CICO_dX;
bool modelPar_given_CICO;
double modelPar_PSCEL;
double d_modelPar_PSCEL_dX;
bool modelPar_given_PSCEL;
double modelPar_PSCELEXP;
double d_modelPar_PSCELEXP_dX;
bool modelPar_given_PSCELEXP;
double modelPar_PSCEW;
double d_modelPar_PSCEW_dX;
bool modelPar_given_PSCEW;
double modelPar_PSCEBO;
double d_modelPar_PSCEBO_dX;
bool modelPar_given_PSCEBO;
double modelPar_NSDDCO;
double d_modelPar_NSDDCO_dX;
bool modelPar_given_NSDDCO;
double modelPar_PSCEDLBO;
double d_modelPar_PSCEDLBO_dX;
bool modelPar_given_PSCEDLBO;
double modelPar_PNCEW;
double d_modelPar_PNCEW_dX;
bool modelPar_given_PNCEW;
double modelPar_CFL;
double d_modelPar_CFL_dX;
bool modelPar_given_CFL;
double modelPar_CFLEXP;
double d_modelPar_CFLEXP_dX;
bool modelPar_given_CFLEXP;
double modelPar_CFW;
double d_modelPar_CFW_dX;
bool modelPar_given_CFW;
double modelPar_CFBO;
double d_modelPar_CFBO_dX;
bool modelPar_given_CFBO;
double modelPar_STCFL;
double d_modelPar_STCFL_dX;
bool modelPar_given_STCFL;
double modelPar_CFDO;
double d_modelPar_CFDO_dX;
bool modelPar_given_CFDO;
double modelPar_CFDLL;
double d_modelPar_CFDLL_dX;
bool modelPar_given_CFDLL;
double modelPar_CFDLW;
double d_modelPar_CFDLW_dX;
bool modelPar_given_CFDLW;
double modelPar_CFDLBO;
double d_modelPar_CFDLBO_dX;
bool modelPar_given_CFDLBO;
double modelPar_UO;
double d_modelPar_UO_dX;
bool modelPar_given_UO;
double modelPar_FBET1;
double d_modelPar_FBET1_dX;
bool modelPar_given_FBET1;
double modelPar_FBET1W;
double d_modelPar_FBET1W_dX;
bool modelPar_given_FBET1W;
double modelPar_LP1;
double d_modelPar_LP1_dX;
bool modelPar_given_LP1;
double modelPar_LP1W;
double d_modelPar_LP1W_dX;
bool modelPar_given_LP1W;
double modelPar_FBET2;
double d_modelPar_FBET2_dX;
bool modelPar_given_FBET2;
double modelPar_LP2;
double d_modelPar_LP2_dX;
bool modelPar_given_LP2;
double modelPar_BETW1;
double d_modelPar_BETW1_dX;
bool modelPar_given_BETW1;
double modelPar_BETW2;
double d_modelPar_BETW2_dX;
bool modelPar_given_BETW2;
double modelPar_WBET;
double d_modelPar_WBET_dX;
bool modelPar_given_WBET;
double modelPar_BETNBO;
double d_modelPar_BETNBO_dX;
bool modelPar_given_BETNBO;
double modelPar_STBETO;
double d_modelPar_STBETO_dX;
bool modelPar_given_STBETO;
double modelPar_STBETL;
double d_modelPar_STBETL_dX;
bool modelPar_given_STBETL;
double modelPar_STBETW;
double d_modelPar_STBETW_dX;
bool modelPar_given_STBETW;
double modelPar_STBETLW;
double d_modelPar_STBETLW_dX;
bool modelPar_given_STBETLW;
double modelPar_CSO;
double d_modelPar_CSO_dX;
bool modelPar_given_CSO;
double modelPar_CSL;
double d_modelPar_CSL_dX;
bool modelPar_given_CSL;
double modelPar_CSLEXP;
double d_modelPar_CSLEXP_dX;
bool modelPar_given_CSLEXP;
double modelPar_CSW;
double d_modelPar_CSW_dX;
bool modelPar_given_CSW;
double modelPar_CSLW;
double d_modelPar_CSLW_dX;
bool modelPar_given_CSLW;
double modelPar_CSFIO;
double d_modelPar_CSFIO_dX;
bool modelPar_given_CSFIO;
double modelPar_CSBIO;
double d_modelPar_CSBIO_dX;
bool modelPar_given_CSBIO;
double modelPar_STCSO;
double d_modelPar_STCSO_dX;
bool modelPar_given_STCSO;
double modelPar_STCSL;
double d_modelPar_STCSL_dX;
bool modelPar_given_STCSL;
double modelPar_STCSW;
double d_modelPar_STCSW_dX;
bool modelPar_given_STCSW;
double modelPar_STCSLW;
double d_modelPar_STCSLW_dX;
bool modelPar_given_STCSLW;
double modelPar_THECSO;
double d_modelPar_THECSO_dX;
bool modelPar_given_THECSO;
double modelPar_STTHECSO;
double d_modelPar_STTHECSO_dX;
bool modelPar_given_STTHECSO;
double modelPar_CSTHRO;
double d_modelPar_CSTHRO_dX;
bool modelPar_given_CSTHRO;
double modelPar_CSTHRBO;
double d_modelPar_CSTHRBO_dX;
bool modelPar_given_CSTHRBO;
double modelPar_MUEO;
double d_modelPar_MUEO_dX;
bool modelPar_given_MUEO;
double modelPar_STMUEO;
double d_modelPar_STMUEO_dX;
bool modelPar_given_STMUEO;
double modelPar_THEMUO;
double d_modelPar_THEMUO_dX;
bool modelPar_given_THEMUO;
double modelPar_STTHEMUO;
double d_modelPar_STTHEMUO_dX;
bool modelPar_given_STTHEMUO;
double modelPar_XCORO;
double d_modelPar_XCORO_dX;
bool modelPar_given_XCORO;
double modelPar_XCORL;
double d_modelPar_XCORL_dX;
bool modelPar_given_XCORL;
double modelPar_XCORLEXP;
double d_modelPar_XCORLEXP_dX;
bool modelPar_given_XCORLEXP;
double modelPar_XCORW;
double d_modelPar_XCORW_dX;
bool modelPar_given_XCORW;
double modelPar_XCORLW;
double d_modelPar_XCORLW_dX;
bool modelPar_given_XCORLW;
double modelPar_XCORBO;
double d_modelPar_XCORBO_dX;
bool modelPar_given_XCORBO;
double modelPar_STXCORO;
double d_modelPar_STXCORO_dX;
bool modelPar_given_STXCORO;
double modelPar_FETAO;
double d_modelPar_FETAO_dX;
bool modelPar_given_FETAO;
double modelPar_RSW1;
double d_modelPar_RSW1_dX;
bool modelPar_given_RSW1;
double modelPar_RSW2;
double d_modelPar_RSW2_dX;
bool modelPar_given_RSW2;
double modelPar_RSIGO;
double d_modelPar_RSIGO_dX;
bool modelPar_given_RSIGO;
double modelPar_STRSO;
double d_modelPar_STRSO_dX;
bool modelPar_given_STRSO;
double modelPar_RSGO;
double d_modelPar_RSGO_dX;
bool modelPar_given_RSGO;
double modelPar_THERSGO;
double d_modelPar_THERSGO_dX;
bool modelPar_given_THERSGO;
double modelPar_RSBO;
double d_modelPar_RSBO_dX;
bool modelPar_given_RSBO;
double modelPar_THESATO;
double d_modelPar_THESATO_dX;
bool modelPar_given_THESATO;
double modelPar_THESATL;
double d_modelPar_THESATL_dX;
bool modelPar_given_THESATL;
double modelPar_THESATLEXP;
double d_modelPar_THESATLEXP_dX;
bool modelPar_given_THESATLEXP;
double modelPar_THESATW;
double d_modelPar_THESATW_dX;
bool modelPar_given_THESATW;
double modelPar_THESATLW;
double d_modelPar_THESATLW_dX;
bool modelPar_given_THESATLW;
double modelPar_STTHESATO;
double d_modelPar_STTHESATO_dX;
bool modelPar_given_STTHESATO;
double modelPar_STTHESATL;
double d_modelPar_STTHESATL_dX;
bool modelPar_given_STTHESATL;
double modelPar_STTHESATW;
double d_modelPar_STTHESATW_dX;
bool modelPar_given_STTHESATW;
double modelPar_STTHESATLW;
double d_modelPar_STTHESATLW_dX;
bool modelPar_given_STTHESATLW;
double modelPar_THESATGO;
double d_modelPar_THESATGO_dX;
bool modelPar_given_THESATGO;
double modelPar_THESATBO;
double d_modelPar_THESATBO_dX;
bool modelPar_given_THESATBO;
double modelPar_AXO;
double d_modelPar_AXO_dX;
bool modelPar_given_AXO;
double modelPar_AXL;
double d_modelPar_AXL_dX;
bool modelPar_given_AXL;
double modelPar_AXLEXP;
double d_modelPar_AXLEXP_dX;
bool modelPar_given_AXLEXP;
double modelPar_AXL2;
double d_modelPar_AXL2_dX;
bool modelPar_given_AXL2;
double modelPar_AXLEXP2;
double d_modelPar_AXLEXP2_dX;
bool modelPar_given_AXLEXP2;
double modelPar_ALPL1;
double d_modelPar_ALPL1_dX;
bool modelPar_given_ALPL1;
double modelPar_ALPLEXP;
double d_modelPar_ALPLEXP_dX;
bool modelPar_given_ALPLEXP;
double modelPar_ALPL2;
double d_modelPar_ALPL2_dX;
bool modelPar_given_ALPL2;
double modelPar_ALPLEXP2;
double d_modelPar_ALPLEXP2_dX;
bool modelPar_given_ALPLEXP2;
double modelPar_ALPW;
double d_modelPar_ALPW_dX;
bool modelPar_given_ALPW;
double modelPar_ALP1L1;
double d_modelPar_ALP1L1_dX;
bool modelPar_given_ALP1L1;
double modelPar_ALP1LEXP;
double d_modelPar_ALP1LEXP_dX;
bool modelPar_given_ALP1LEXP;
double modelPar_ALP1L2;
double d_modelPar_ALP1L2_dX;
bool modelPar_given_ALP1L2;
double modelPar_ALP1LEXP2;
double d_modelPar_ALP1LEXP2_dX;
bool modelPar_given_ALP1LEXP2;
double modelPar_ALP1W;
double d_modelPar_ALP1W_dX;
bool modelPar_given_ALP1W;
double modelPar_ALPBO;
double d_modelPar_ALPBO_dX;
bool modelPar_given_ALPBO;
double modelPar_VPO;
double d_modelPar_VPO_dX;
bool modelPar_given_VPO;
double modelPar_VPGO;
double d_modelPar_VPGO_dX;
bool modelPar_given_VPGO;
double modelPar_GCOO;
double d_modelPar_GCOO_dX;
bool modelPar_given_GCOO;
double modelPar_IGINVLW;
double d_modelPar_IGINVLW_dX;
bool modelPar_given_IGINVLW;
double modelPar_IGOVINVW;
double d_modelPar_IGOVINVW_dX;
bool modelPar_given_IGOVINVW;
double modelPar_IGOVINVDW;
double d_modelPar_IGOVINVDW_dX;
bool modelPar_given_IGOVINVDW;
double modelPar_IGOVACCW;
double d_modelPar_IGOVACCW_dX;
bool modelPar_given_IGOVACCW;
double modelPar_IGOVACCDW;
double d_modelPar_IGOVACCDW_dX;
bool modelPar_given_IGOVACCDW;
double modelPar_STIGO;
double d_modelPar_STIGO_dX;
bool modelPar_given_STIGO;
double modelPar_GC2CHO;
double d_modelPar_GC2CHO_dX;
bool modelPar_given_GC2CHO;
double modelPar_GC3CHO;
double d_modelPar_GC3CHO_dX;
bool modelPar_given_GC3CHO;
double modelPar_GC2OVINVO;
double d_modelPar_GC2OVINVO_dX;
bool modelPar_given_GC2OVINVO;
double modelPar_GC3OVINVO;
double d_modelPar_GC3OVINVO_dX;
bool modelPar_given_GC3OVINVO;
double modelPar_GC2OVACCO;
double d_modelPar_GC2OVACCO_dX;
bool modelPar_given_GC2OVACCO;
double modelPar_GC3OVACCO;
double d_modelPar_GC3OVACCO_dX;
bool modelPar_given_GC3OVACCO;
double modelPar_GCDOVL;
double d_modelPar_GCDOVL_dX;
bool modelPar_given_GCDOVL;
double modelPar_GCVDOVO;
double d_modelPar_GCVDOVO_dX;
bool modelPar_given_GCVDOVO;
double modelPar_CHIBO;
double d_modelPar_CHIBO_dX;
bool modelPar_given_CHIBO;
double modelPar_NIGINVO;
double d_modelPar_NIGINVO_dX;
bool modelPar_given_NIGINVO;
double modelPar_FNOVINVW;
double d_modelPar_FNOVINVW_dX;
bool modelPar_given_FNOVINVW;
double modelPar_FNOVINVDW;
double d_modelPar_FNOVINVDW_dX;
bool modelPar_given_FNOVINVDW;
double modelPar_GCOVINVFNO;
double d_modelPar_GCOVINVFNO_dX;
bool modelPar_given_GCOVINVFNO;
double modelPar_STIGFNO;
double d_modelPar_STIGFNO_dX;
bool modelPar_given_STIGFNO;
double modelPar_AGIDLO;
double d_modelPar_AGIDLO_dX;
bool modelPar_given_AGIDLO;
double modelPar_AGIDLDO;
double d_modelPar_AGIDLDO_dX;
bool modelPar_given_AGIDLDO;
double modelPar_AGIDLW;
double d_modelPar_AGIDLW_dX;
bool modelPar_given_AGIDLW;
double modelPar_AGIDLDW;
double d_modelPar_AGIDLDW_dX;
bool modelPar_given_AGIDLDW;
double modelPar_BGIDLO;
double d_modelPar_BGIDLO_dX;
bool modelPar_given_BGIDLO;
double modelPar_BGIDLDO;
double d_modelPar_BGIDLDO_dX;
bool modelPar_given_BGIDLDO;
double modelPar_STBGIDLO;
double d_modelPar_STBGIDLO_dX;
bool modelPar_given_STBGIDLO;
double modelPar_STBGIDLDO;
double d_modelPar_STBGIDLDO_dX;
bool modelPar_given_STBGIDLDO;
double modelPar_CGIDLO;
double d_modelPar_CGIDLO_dX;
bool modelPar_given_CGIDLO;
double modelPar_CGIDLDO;
double d_modelPar_CGIDLDO_dX;
bool modelPar_given_CGIDLDO;
double modelPar_DGIDLO;
double d_modelPar_DGIDLO_dX;
bool modelPar_given_DGIDLO;
double modelPar_DGIDLDO;
double d_modelPar_DGIDLDO_dX;
bool modelPar_given_DGIDLDO;
double modelPar_DGIDLL;
double d_modelPar_DGIDLL_dX;
bool modelPar_given_DGIDLL;
double modelPar_DGIDLDL;
double d_modelPar_DGIDLDL_dX;
bool modelPar_given_DGIDLDL;
double modelPar_A1O;
double d_modelPar_A1O_dX;
bool modelPar_given_A1O;
double modelPar_A1L;
double d_modelPar_A1L_dX;
bool modelPar_given_A1L;
double modelPar_A1W;
double d_modelPar_A1W_dX;
bool modelPar_given_A1W;
double modelPar_A2O;
double d_modelPar_A2O_dX;
bool modelPar_given_A2O;
double modelPar_STA2O;
double d_modelPar_STA2O_dX;
bool modelPar_given_STA2O;
double modelPar_A3O;
double d_modelPar_A3O_dX;
bool modelPar_given_A3O;
double modelPar_A3L;
double d_modelPar_A3L_dX;
bool modelPar_given_A3L;
double modelPar_A3W;
double d_modelPar_A3W_dX;
bool modelPar_given_A3W;
double modelPar_CGBOVO;
double d_modelPar_CGBOVO_dX;
bool modelPar_given_CGBOVO;
double modelPar_CGBOVL;
double d_modelPar_CGBOVL_dX;
bool modelPar_given_CGBOVL;
double modelPar_NSDACO;
double d_modelPar_NSDACO_dX;
bool modelPar_given_NSDACO;
double modelPar_FIFW;
double d_modelPar_FIFW_dX;
bool modelPar_given_FIFW;
double modelPar_FSCEACO;
double d_modelPar_FSCEACO_dX;
bool modelPar_given_FSCEACO;
double modelPar_LOVO;
double d_modelPar_LOVO_dX;
bool modelPar_given_LOVO;
double modelPar_LOVDO;
double d_modelPar_LOVDO_dX;
bool modelPar_given_LOVDO;
double modelPar_COVDLO;
double d_modelPar_COVDLO_dX;
bool modelPar_given_COVDLO;
double modelPar_COVDLW;
double d_modelPar_COVDLW_dX;
bool modelPar_given_COVDLW;
double modelPar_COVDLBO;
double d_modelPar_COVDLBO_dX;
bool modelPar_given_COVDLBO;
double modelPar_DVFBOVO;
double d_modelPar_DVFBOVO_dX;
bool modelPar_given_DVFBOVO;
double modelPar_CFRO;
double d_modelPar_CFRO_dX;
bool modelPar_given_CFRO;
double modelPar_CFRDO;
double d_modelPar_CFRDO_dX;
bool modelPar_given_CFRDO;
double modelPar_CFRW;
double d_modelPar_CFRW_dX;
bool modelPar_given_CFRW;
double modelPar_CFRDW;
double d_modelPar_CFRDW_dX;
bool modelPar_given_CFRDW;
double modelPar_CSDO;
double d_modelPar_CSDO_dX;
bool modelPar_given_CSDO;
double modelPar_CSDBPO;
double d_modelPar_CSDBPO_dX;
bool modelPar_given_CSDBPO;
double modelPar_RTHO;
double d_modelPar_RTHO_dX;
bool modelPar_given_RTHO;
double modelPar_RTHL;
double d_modelPar_RTHL_dX;
bool modelPar_given_RTHL;
double modelPar_RTHW;
double d_modelPar_RTHW_dX;
bool modelPar_given_RTHW;
double modelPar_RTHLW;
double d_modelPar_RTHLW_dX;
bool modelPar_given_RTHLW;
double modelPar_STRTHO;
double d_modelPar_STRTHO_dX;
bool modelPar_given_STRTHO;
double modelPar_CTHO;
double d_modelPar_CTHO_dX;
bool modelPar_given_CTHO;
double modelPar_LAMBTHO;
double d_modelPar_LAMBTHO_dX;
bool modelPar_given_LAMBTHO;
double modelPar_FTHO;
double d_modelPar_FTHO_dX;
bool modelPar_given_FTHO;
double modelPar_FNTO;
double d_modelPar_FNTO_dX;
bool modelPar_given_FNTO;
double modelPar_FNTEXCL;
double d_modelPar_FNTEXCL_dX;
bool modelPar_given_FNTEXCL;
double modelPar_FNTEXCLEXP;
double d_modelPar_FNTEXCLEXP_dX;
bool modelPar_given_FNTEXCLEXP;
double modelPar_NFALW;
double d_modelPar_NFALW_dX;
bool modelPar_given_NFALW;
double modelPar_NFAW;
double d_modelPar_NFAW_dX;
bool modelPar_given_NFAW;
double modelPar_NFBLW;
double d_modelPar_NFBLW_dX;
bool modelPar_given_NFBLW;
double modelPar_NFCLW;
double d_modelPar_NFCLW_dX;
bool modelPar_given_NFCLW;
double modelPar_NFEO;
double d_modelPar_NFEO_dX;
bool modelPar_given_NFEO;
double modelPar_NFEBO;
double d_modelPar_NFEBO_dX;
bool modelPar_given_NFEBO;
double modelPar_EFO;
double d_modelPar_EFO_dX;
bool modelPar_given_EFO;
double modelPar_SAREF;
double d_modelPar_SAREF_dX;
bool modelPar_given_SAREF;
double modelPar_SBREF;
double d_modelPar_SBREF_dX;
bool modelPar_given_SBREF;
double modelPar_WLOD;
double d_modelPar_WLOD_dX;
bool modelPar_given_WLOD;
double modelPar_KUO;
double d_modelPar_KUO_dX;
bool modelPar_given_KUO;
double modelPar_KVSAT;
double d_modelPar_KVSAT_dX;
bool modelPar_given_KVSAT;
double modelPar_TKUO;
double d_modelPar_TKUO_dX;
bool modelPar_given_TKUO;
double modelPar_LKUO;
double d_modelPar_LKUO_dX;
bool modelPar_given_LKUO;
double modelPar_WKUO;
double d_modelPar_WKUO_dX;
bool modelPar_given_WKUO;
double modelPar_PKUO;
double d_modelPar_PKUO_dX;
bool modelPar_given_PKUO;
double modelPar_LLODKUO;
double d_modelPar_LLODKUO_dX;
bool modelPar_given_LLODKUO;
double modelPar_WLODKUO;
double d_modelPar_WLODKUO_dX;
bool modelPar_given_WLODKUO;
double modelPar_KVTHO;
double d_modelPar_KVTHO_dX;
bool modelPar_given_KVTHO;
double modelPar_LKVTHO;
double d_modelPar_LKVTHO_dX;
bool modelPar_given_LKVTHO;
double modelPar_WKVTHO;
double d_modelPar_WKVTHO_dX;
bool modelPar_given_WKVTHO;
double modelPar_PKVTHO;
double d_modelPar_PKVTHO_dX;
bool modelPar_given_PKVTHO;
double modelPar_LLODVTH;
double d_modelPar_LLODVTH_dX;
bool modelPar_given_LLODVTH;
double modelPar_WLODVTH;
double d_modelPar_WLODVTH_dX;
bool modelPar_given_WLODVTH;
double modelPar_STETAO;
double d_modelPar_STETAO_dX;
bool modelPar_given_STETAO;
double modelPar_LODETAO;
double d_modelPar_LODETAO_dX;
bool modelPar_given_LODETAO;
double modelPar_STRLAMBDA;
double d_modelPar_STRLAMBDA_dX;
bool modelPar_given_STRLAMBDA;
double modelPar_STRALPHA;
double d_modelPar_STRALPHA_dX;
bool modelPar_given_STRALPHA;
double modelPar_STRDVFBO;
double d_modelPar_STRDVFBO_dX;
bool modelPar_given_STRDVFBO;
double modelPar_STRWDVFBO;
double d_modelPar_STRWDVFBO_dX;
bool modelPar_given_STRWDVFBO;
double modelPar_STRDCFL;
double d_modelPar_STRDCFL_dX;
bool modelPar_given_STRDCFL;
double modelPar_STRRUO;
double d_modelPar_STRRUO_dX;
bool modelPar_given_STRRUO;
double modelPar_STRTRUO;
double d_modelPar_STRTRUO_dX;
bool modelPar_given_STRTRUO;
double modelPar_STRRVSAT;
double d_modelPar_STRRVSAT_dX;
bool modelPar_given_STRRVSAT;
// non-reals (including hidden)
int modelPar_SWSCALE;
bool modelPar_given_SWSCALE;
int modelPar_SWSUBDEP;
bool modelPar_given_SWSUBDEP;
int modelPar_SWIGATE;
bool modelPar_given_SWIGATE;
int modelPar_SWGIDL;
bool modelPar_given_SWGIDL;
int modelPar_SWSHE;
bool modelPar_given_SWSHE;
int modelPar_SWIGN;
bool modelPar_given_SWIGN;
int modelPar_SWJUNASYM;
bool modelPar_given_SWJUNASYM;
int modelPar_SWIMPACT;
bool modelPar_given_SWIMPACT;
int modelPar_TYPE;
bool modelPar_given_TYPE;
int modelPar_SWSTRESS;
bool modelPar_given_SWSTRESS;
// model variables
// reals
double modelVar_TKR;
double d_modelVar_TKR_dX;double modelVar_TKD;
double modelVar_gmin;
// non-reals
int modelVar_SWSHE_i;};



//-----------------------------------------------------------------------------
// Free functions used by sensitivity
//
//-----------------------------------------------------------------------------
void evaluateModelEquations(
std::vector <double> & probeVars,
// probe constants
const int admsProbeID_V_D_GND,
const int admsProbeID_V_S_GND,
const int admsProbeID_V_B_GND,
const int admsProbeID_V_G_GND,
const int admsProbeID_I_NSIG_GND,
const int admsProbeID_V_NSIG_GND,
const int admsProbeID_Temp_Tnode_GND,
const int admsProbeID_V_S_B,
const int admsProbeID_V_D_S,
const int admsProbeID_V_G_S,
// node constants
const int admsNodeID_D,
const int admsNodeID_G,
const int admsNodeID_S,
const int admsNodeID_B,
const int admsNodeID_Tnode,
const int admsNodeID_NSIG,
const int admsBRA_ID_NSIG_GND,
instanceSensStruct & instanceStruct,
modelSensStruct & modelStruct,
// basic variables
 double admsTemperature, double adms_vt_nom, double ADMSgmin_arg, std::vector <double> & d_staticContributions_dX, std::vector <double> & d_dynamicContributions_dX, const Instance & theInstance);

void evaluateInitialInstance(
instanceSensStruct & instanceStruct,
modelSensStruct & modelStruct,
 double admsTemperature,double adms_vt_nom, double ADMSgmin_arg, const Instance & theInstance);

void evaluateInitialModel(
modelSensStruct & modelStruct,
 double admsTemperature, double ADMSgmin_arg, const Instance & theInstance);

#endif // Xyce_ADMS_SENSITIVITIES


// Limited exponential --- NOT what verilog LRM says, but what qucs,
// ng-spice, and zspice do.

template <typename T>
T limexp(const T &x)
{
  if ((x) < 80.0)
  return (exp(x));
  else
  return (exp(80.0)*(x-79.0));
}


struct Traits: public DeviceTraits<Model, Instance, MOSFET1::Traits>
{
  static const char *name() {return "L_UTSOI MOSFET";}
  static const char *deviceTypeName() {return "M level 10240";}

  static int numNodes() {return 5;}


  static bool modelRequired() {return true;}
  static bool isLinearDevice() {return false;}

  static Device *factory(const Configuration &configuration, const FactoryBlock &factory_block);
  static void loadModelParameters(ParametricData<Model> &model_parameters);
  static void loadInstanceParameters(ParametricData<Instance> &instance_parameters);
};

//-----------------------------------------------------------------------------
// Class         : Instance

//
// Purpose       : This class represents a single instance  of the
//                 device.  It mainly contains indices and pointers into
//                 the matrix equation (see the resistor instance class for
//                 more details).
//
// Special Notes :
// Creator       :
// Creation Date :
//-----------------------------------------------------------------------------
class Instance : public DeviceInstance
{
  friend class ParametricData<Instance>;
  friend class Model;
#ifdef Xyce_ADMS_SENSITIVITIES
  friend class InstanceSensitivity;
  friend class ModelSensitivity;
#endif // Xyce_ADMS_SENSITIVITIES
  friend struct Traits;

  public:
    Instance(
      const Configuration &       configuration,
      const InstanceBlock &       instance_block,
      Model &                     model,
      const FactoryBlock &        factory_block);

    ~Instance();

private:
    Instance(const Instance &);
    Instance &operator=(const Instance &);

public:
    void registerLIDs( const LocalIdVector & intLIDVecRef,
                       const LocalIdVector & extLIDVecRef );
    void registerStoreLIDs( const LocalIdVector & stoLIDVecRef );
    void setupPointers();

    void loadNodeSymbols(Util::SymbolTable &symbol_table) const;

    const JacobianStamp & jacobianStamp() const;
    void registerJacLIDs( const JacobianStamp & jacLIDVec );

    void registerBranchDataLIDs(const std::vector<int> & branchLIDVecRef);

    bool processParams();
    bool updateTemperature ( const double & temp = -999.0 );
    bool updateIntermediateVars ();
    bool updatePrimaryState ();
    bool updateSecondaryState ();

    // load functions, residual:
    bool loadDAEQVector ();
    bool loadDAEFVector ();

    // load functions, Jacobian:
    bool loadDAEdQdx ();
    bool loadDAEdFdx ();

      int getNumNoiseSources () const;  // 6
      void setupNoiseSources (Xyce::Analysis::NoiseData & noiseData);
      void getNoiseSources (Xyce::Analysis::NoiseData & noiseData);

  private:

  public:
    // iterator reference to the l_utsoi model which owns this instance.
    // Getters and setters
    Model &getModel()
    {
      return model_;
    }

  private:

    Model & model_;   //< Owning Model
    // Begin verilog Instance Variables
    //   Instance Parameters
    double L;
    double W;
    double ASOURCE;
    double ADRAIN;
    double PSOURCE;
    double PDRAIN;
    double SA;
    double SB;
    double SD;
    int NF;
    int MULT;
    double DELVTO;
    double FACTUO;
    int M;
    //  Variables of global_instance scope
    double ASOURCE_i;
    double ADRAIN_i;
    double PSOURCE_i;
    double PDRAIN_i;
    double MULT_i;
    double VFB1_i;
     double d_VFB1_i_dTemp_Tnode_GND;
    double CIC1_i;
    double PSCE1_i;
    double CF1_i;
     double d_CF1_i_dTemp_Tnode_GND;
    double BETN1_i;
     double d_BETN1_i_dTemp_Tnode_GND;
    double THESAT1_i;
    double VFB2_i;
     double d_VFB2_i_dTemp_Tnode_GND;
    double CIC2_i;
    double PSCE2_i;
    double CF2_i;
     double d_CF2_i_dTemp_Tnode_GND;
    double BETN2_i;
     double d_BETN2_i_dTemp_Tnode_GND;
    double THESAT2_i;
    double TSI_i;
    double XGE_i;
    double TYPESUB_i;
    double NOV_i;
    double NOVD_i;
    double STVFB_i;
    double NSDDC_i;
    double PSCEDLB_i;
    double STCF_i;
    double CFD_i;
    double CFDL_i;
    double CFDLB_i;
    double STBET_i;
    double MUE_i;
     double d_MUE_i_dTemp_Tnode_GND;
    double STMUE_i;
    double THEMU_i;
     double d_THEMU_i_dTemp_Tnode_GND;
    double STTHEMU_i;
    double CS_i;
     double d_CS_i_dTemp_Tnode_GND;
    double CSFI_i;
    double CSBI_i;
    double STCS_i;
    double THECS_i;
     double d_THECS_i_dTemp_Tnode_GND;
    double STTHECS_i;
    double STXCOR_i;
    double RS_i;
     double d_RS_i_dTemp_Tnode_GND;
    double RSIG_i;
    double STRS_i;
    double RSG_i;
    double THERSG_i;
    double RSB_i;
    double CT_i;
    double TOXP_i;
    double XCOR_i;
     double d_XCOR_i_dTemp_Tnode_GND;
    double XCORB_i;
    double THESAT_i;
     double d_THESAT_i_dTemp_Tnode_GND;
    double STTHESAT_i;
    double ALP_i;
    double ALP1_i;
    double ALPB_i;
    double VP_i;
    double VPG_i;
    double GCO_i;
    double IGINV_i;
     double d_IGINV_i_dTemp_Tnode_GND;
    double IGOVINV_i;
     double d_IGOVINV_i_dTemp_Tnode_GND;
    double IGOVINVD_i;
     double d_IGOVINVD_i_dTemp_Tnode_GND;
    double IGOVACC_i;
     double d_IGOVACC_i_dTemp_Tnode_GND;
    double IGOVACCD_i;
     double d_IGOVACCD_i_dTemp_Tnode_GND;
    double STIG_i;
    double STIGFN_i;
    double FNOVINV_i;
     double d_FNOVINV_i_dTemp_Tnode_GND;
    double FNOVINVD_i;
     double d_FNOVINVD_i_dTemp_Tnode_GND;
    double GC2CH_i;
    double GC3CH_i;
    double GC2OVINV_i;
    double GC3OVINV_i;
    double GC2OVACC_i;
    double GC3OVACC_i;
    double GCDOV_i;
    double GCVDOV_i;
    double CHIB_i;
    double NIGINV_i;
    double GCOVINVFN_i;
    double AGIDL_i;
    double AGIDLD_i;
    double BGIDL_i;
     double d_BGIDL_i_dTemp_Tnode_GND;
    double BGIDLD_i;
     double d_BGIDLD_i_dTemp_Tnode_GND;
    double STBGIDL_i;
    double STBGIDLD_i;
    double CGIDL_i;
    double CGIDLD_i;
    double DGIDL_i;
    double DGIDLD_i;
    double A1_i;
    double A2_i;
     double d_A2_i_dTemp_Tnode_GND;
    double STA2_i;
    double A3_i;
    double AREAQ_i;
    double CGBOV_i;
    double NSDAC_i;
    double FIF_i;
    double FSCEAC_i;
    double COV_i;
    double COVD_i;
    double COVDL_i;
    double COVDLB_i;
    double DVFBOV_i;
    double CFR_i;
    double CFRD_i;
    double CSD_i;
    double CSDBP_i;
    double RTH_i;
     double d_RTH_i_dTemp_Tnode_GND;
    double STRTH_i;
    double CTH_i;
    double FNT_i;
    double FNTEXC_i;
    double NFA_i;
    double NFB_i;
    double NFC_i;
    double NFE_i;
    double NFEB_i;
    double EF_i;
    double VFB1_t;
    double CF1_t;
    double BETN1_t;
    double VFB2_t;
    double CF2_t;
    double BETN2_t;
    double MUE_t;
    double THEMU_t;
    double CS_t;
    double THECS_t;
    double RS_t;
    double XCOR_t;
    double THESAT_t;
    double IGINV_t;
    double IGOVINV_t;
    double IGOVINVD_t;
    double IGOVACC_t;
    double IGOVACCD_t;
    double FNOVINV_t;
    double FNOVINVD_t;
    double BGIDL_t;
    double BGIDLD_t;
    double A2_t;
    double RTH_t;
    double gamAX;
    double temp;
     double d_temp_dV_G_S;
     double d_temp_dV_D_S;
     double d_temp_dV_S_B;
     double d_temp_dTemp_Tnode_GND;
    double temp1;
     double d_temp1_dV_S_B;
     double d_temp1_dV_G_S;
     double d_temp1_dV_D_S;
     double d_temp1_dTemp_Tnode_GND;
    double temp2;
     double d_temp2_dV_G_S;
     double d_temp2_dTemp_Tnode_GND;
     double d_temp2_dV_D_S;
     double d_temp2_dV_S_B;
    double temp3;
     double d_temp3_dV_G_S;
     double d_temp3_dV_D_S;
     double d_temp3_dTemp_Tnode_GND;
     double d_temp3_dV_S_B;
    double temp4;
     double d_temp4_dV_G_S;
     double d_temp4_dV_D_S;
     double d_temp4_dTemp_Tnode_GND;
     double d_temp4_dV_S_B;
    double TKC;
     double d_TKC_dTemp_Tnode_GND;
    double TKC_sq;
     double d_TKC_sq_dTemp_Tnode_GND;
    double DTC;
     double d_DTC_dTemp_Tnode_GND;
    double dT;
     double d_dT_dTemp_Tnode_GND;
    double rT;
     double d_rT_dTemp_Tnode_GND;
    double rTn;
     double d_rTn_dTemp_Tnode_GND;
    double phit0;
     double d_phit0_dTemp_Tnode_GND;
    double inv_phit0;
     double d_inv_phit0_dTemp_Tnode_GND;
    double phit;
     double d_phit_dTemp_Tnode_GND;
    double inv_phit;
     double d_inv_phit_dTemp_Tnode_GND;
    double one_m_xge;
    double epsch;
    double EgSi;
     double d_EgSi_dTemp_Tnode_GND;
    double EgGe;
     double d_EgGe_dTemp_Tnode_GND;
    double dEg;
     double d_dEg_dTemp_Tnode_GND;
    double Eg;
     double d_Eg_dTemp_Tnode_GND;
    double Eg_2phit0;
     double d_Eg_2phit0_dTemp_Tnode_GND;
    double Eg_2phit;
     double d_Eg_2phit_dTemp_Tnode_GND;
    double dVfbch;
     double d_dVfbch_dTemp_Tnode_GND;
    double niratio;
    double Cox2Init;
    double Cox1Prime;
    double Cox2Prime;
    double dVfb1Nch;
    double dVfb2Nch;
    double CsiPrime_0;
    double k1_1D;
    double k2_1D;
    double keq_1D;
    double neff;
     double d_neff_dTemp_Tnode_GND;
    double A0_Csisq;
     double d_A0_Csisq_dTemp_Tnode_GND;
    double xth_1D;
     double d_xth_1D_dTemp_Tnode_GND;
    double xSDdep;
     double d_xSDdep_dTemp_Tnode_GND;
    double dVfbQM;
    double qq;
     double d_qq_dTemp_Tnode_GND;
    double tsisq;
    double Gfsub;
    double Gfsub2;
    double inv_Gfsub2;
    double xisub;
    double inv_xisub;
    double margin_sub;
    double xn_sub;
    double fmue;
     double d_fmue_dTemp_Tnode_GND;
    double inv_qi1cs;
    double inv_qi2cs;
    double eta_mu;
    double one_m_eta;
    double frs;
     double d_frs_dTemp_Tnode_GND;
    double sat_phit;
     double d_sat_phit_dTemp_Tnode_GND;
    double alp1_phit;
     double d_alp1_phit_dTemp_Tnode_GND;
    double inv_CHIB;
    double tempM;
     double d_tempM_dTemp_Tnode_GND;
    double BCH;
    double BOV;
    double GCQCH;
    double GCQOVINV;
    double GCQOVACC;
    double alpha_b;
     double d_alpha_b_dTemp_Tnode_GND;
    double Dch;
     double d_Dch_dTemp_Tnode_GND;
    double Dov;
     double d_Dov_dTemp_Tnode_GND;
    double n_iginv;
     double d_n_iginv_dTemp_Tnode_GND;
    double area_phit;
     double d_area_phit_dTemp_Tnode_GND;
    double inner_sd;
     double d_inner_sd_dTemp_Tnode_GND;
    double xsd;
     double d_xsd_dTemp_Tnode_GND;
    double fif_phit;
     double d_fif_phit_dTemp_Tnode_GND;
    double lambda2D;
    double lnrTn;
     double d_lnrTn_dTemp_Tnode_GND;
    double tf_bet;
     double d_tf_bet_dTemp_Tnode_GND;
    double tf_mue;
     double d_tf_mue_dTemp_Tnode_GND;
    double tf_themu;
     double d_tf_themu_dTemp_Tnode_GND;
    double tf_cs;
     double d_tf_cs_dTemp_Tnode_GND;
    double tf_thecs;
     double d_tf_thecs_dTemp_Tnode_GND;
    double tf_xcor;
     double d_tf_xcor_dTemp_Tnode_GND;
    double tf_ther;
     double d_tf_ther_dTemp_Tnode_GND;
    double tf_thesat;
     double d_tf_thesat_dTemp_Tnode_GND;
    double tf_ig;
     double d_tf_ig_dTemp_Tnode_GND;
    double tf_rth;
     double d_tf_rth_dTemp_Tnode_GND;
    double nt;
     double d_nt_dTemp_Tnode_GND;
    double nt0;
    double fac_exc;
    double sigVds;
    double CsiPrime;
     double d_CsiPrime_dV_G_S;
     double d_CsiPrime_dV_D_S;
     double d_CsiPrime_dTemp_Tnode_GND;
     double d_CsiPrime_dV_S_B;
    double xd0;
     double d_xd0_dTemp_Tnode_GND;
    double k1;
     double d_k1_dV_G_S;
     double d_k1_dV_D_S;
     double d_k1_dTemp_Tnode_GND;
     double d_k1_dV_S_B;
    double qis;
     double d_qis_dTemp_Tnode_GND;
     double d_qis_dV_G_S;
     double d_qis_dV_D_S;
     double d_qis_dV_S_B;
    double ds;
     double d_ds_dV_G_S;
     double d_ds_dV_D_S;
     double d_ds_dTemp_Tnode_GND;
     double d_ds_dV_S_B;
    double qid;
     double d_qid_dTemp_Tnode_GND;
     double d_qid_dV_G_S;
     double d_qid_dV_D_S;
     double d_qid_dV_S_B;
    double dd;
     double d_dd_dV_G_S;
     double d_dd_dV_D_S;
     double d_dd_dTemp_Tnode_GND;
     double d_dd_dV_S_B;
    double esurf1;
     double d_esurf1_dV_S_B;
     double d_esurf1_dV_G_S;
     double d_esurf1_dV_D_S;
     double d_esurf1_dTemp_Tnode_GND;
    double qmfact1;
     double d_qmfact1_dV_G_S;
     double d_qmfact1_dV_D_S;
     double d_qmfact1_dTemp_Tnode_GND;
     double d_qmfact1_dV_S_B;
    double esurf2;
     double d_esurf2_dV_G_S;
     double d_esurf2_dTemp_Tnode_GND;
     double d_esurf2_dV_D_S;
     double d_esurf2_dV_S_B;
    double betneff;
     double d_betneff_dV_S_B;
     double d_betneff_dV_G_S;
     double d_betneff_dV_D_S;
     double d_betneff_dTemp_Tnode_GND;
    double xdeff;
     double d_xdeff_dV_D_S;
     double d_xdeff_dTemp_Tnode_GND;
     double d_xdeff_dV_G_S;
     double d_xdeff_dV_S_B;
    double qim;
     double d_qim_dTemp_Tnode_GND;
     double d_qim_dV_G_S;
     double d_qim_dV_D_S;
     double d_qim_dV_S_B;
    double Gmob;
     double d_Gmob_dV_G_S;
     double d_Gmob_dTemp_Tnode_GND;
     double d_Gmob_dV_D_S;
     double d_Gmob_dV_S_B;
    double FdL;
     double d_FdL_dTemp_Tnode_GND;
     double d_FdL_dV_G_S;
     double d_FdL_dV_D_S;
     double d_FdL_dV_S_B;
    double Ggamma;
     double d_Ggamma_dTemp_Tnode_GND;
     double d_Ggamma_dV_D_S;
     double d_Ggamma_dV_G_S;
     double d_Ggamma_dV_S_B;
    double zsat;
     double d_zsat_dTemp_Tnode_GND;
     double d_zsat_dV_D_S;
     double d_zsat_dV_G_S;
     double d_zsat_dV_S_B;
    double hsat;
     double d_hsat_dTemp_Tnode_GND;
     double d_hsat_dV_D_S;
     double d_hsat_dV_G_S;
     double d_hsat_dV_S_B;
    double Gvsat;
     double d_Gvsat_dV_G_S;
     double d_Gvsat_dTemp_Tnode_GND;
     double d_Gvsat_dV_D_S;
     double d_Gvsat_dV_S_B;
    double qmfact;
     double d_qmfact_dV_S_B;
     double d_qmfact_dV_G_S;
     double d_qmfact_dV_D_S;
     double d_qmfact_dTemp_Tnode_GND;
    double fact_Ids;
     double d_fact_Ids_dTemp_Tnode_GND;
     double d_fact_Ids_dV_S_B;
     double d_fact_Ids_dV_G_S;
     double d_fact_Ids_dV_D_S;
    double Ids;
     double d_Ids_dTemp_Tnode_GND;
     double d_Ids_dV_S_B;
     double d_Ids_dV_G_S;
     double d_Ids_dV_D_S;
    double delta_k1q1;
     double d_delta_k1q1_dV_G_S;
     double d_delta_k1q1_dV_D_S;
     double d_delta_k1q1_dTemp_Tnode_GND;
     double d_delta_k1q1_dV_S_B;
    double inv_k1h1_0;
     double d_inv_k1h1_0_dTemp_Tnode_GND;
     double d_inv_k1h1_0_dV_G_S;
     double d_inv_k1h1_0_dV_D_S;
     double d_inv_k1h1_0_dV_S_B;
    double Igse;
     double d_Igse_dTemp_Tnode_GND;
     double d_Igse_dV_G_S;
     double d_Igse_dV_D_S;
     double d_Igse_dV_S_B;
    double Igde;
     double d_Igde_dTemp_Tnode_GND;
     double d_Igde_dV_G_S;
     double d_Igde_dV_D_S;
     double d_Igde_dV_S_B;
    double Igidle;
     double d_Igidle_dV_D_S;
     double d_Igidle_dTemp_Tnode_GND;
     double d_Igidle_dV_G_S;
     double d_Igidle_dV_S_B;
    double Igisle;
     double d_Igisle_dV_D_S;
     double d_Igisle_dTemp_Tnode_GND;
     double d_Igisle_dV_G_S;
     double d_Igisle_dV_S_B;
    double mavl;
     double d_mavl_dV_D_S;
     double d_mavl_dTemp_Tnode_GND;
     double d_mavl_dV_G_S;
     double d_mavl_dV_S_B;
    double Iimpact;
     double d_Iimpact_dV_D_S;
     double d_Iimpact_dTemp_Tnode_GND;
     double d_Iimpact_dV_G_S;
     double d_Iimpact_dV_S_B;
    double type;
    double vds;
    double vsb;
    double vgs;
    double vth;
    double vth_drive;
    double vdsat;
    double vdsat_marg;
    double id;
     double d_id_dTemp_Tnode_GND;
     double d_id_dV_S_B;
     double d_id_dV_G_S;
     double d_id_dV_D_S;
    double ig;
    double is;
    double ib;
    double ids;
    double igidl;
     double d_igidl_dV_D_S;
     double d_igidl_dTemp_Tnode_GND;
     double d_igidl_dV_G_S;
     double d_igidl_dV_S_B;
    double igisl;
     double d_igisl_dV_D_S;
     double d_igisl_dTemp_Tnode_GND;
     double d_igisl_dV_G_S;
     double d_igisl_dV_S_B;
    double igs;
    double igd;
     double d_igd_dTemp_Tnode_GND;
     double d_igd_dV_G_S;
     double d_igd_dV_D_S;
     double d_igd_dV_S_B;
    double idb;
    double isb;
    double gm;
    double gmb;
    double gds;
    double cgg;
    double cgd;
    double cgs;
    double cgb;
    double cdd;
    double cdg;
    double cds;
    double cdb;
    double cbb;
    double cbg;
    double cbs;
    double cbd;
    double css;
    double csg;
    double csb;
    double csd;
    double tk;
    double dtsh;
    double self_gain;
    double rout;
    double beff;
    double ft;
    double rgate;
    double gmoverid;
    double vearly;
    // end verilog Instance Variables=====
    // Nodal LID Variables
    int li_D;
    int li_G;
    int li_S;
    int li_B;
    int li_Tnode;
    int li_NSIG;
    // end Nodal LID Variables
    // Branch LID Variables
    int li_BRA_NSIG_GND;
    // end Branch LID Variables
    // Lead (branch) LID Variables
    int li_branch_iD;
    int li_branch_iG;
    int li_branch_iS;
    int li_branch_iB;
    int li_branch_iTnode;
    // end Lead (branch) LID Variables
    // Jacobian  pointers
    double * f_S_Equ_D_Node_Ptr;
    double * f_S_Equ_S_Node_Ptr;
    double * f_D_Equ_D_Node_Ptr;
    double * f_D_Equ_S_Node_Ptr;
    double * f_S_Equ_G_Node_Ptr;
    double * f_D_Equ_G_Node_Ptr;
    double * f_S_Equ_B_Node_Ptr;
    double * f_D_Equ_B_Node_Ptr;
    double * f_S_Equ_Tnode_Node_Ptr;
    double * f_D_Equ_Tnode_Node_Ptr;
    double * f_G_Equ_S_Node_Ptr;
    double * f_G_Equ_B_Node_Ptr;
    double * f_G_Equ_D_Node_Ptr;
    double * f_G_Equ_G_Node_Ptr;
    double * f_G_Equ_Tnode_Node_Ptr;
    double * f_Tnode_Equ_Tnode_Node_Ptr;
    double * f_Tnode_Equ_S_Node_Ptr;
    double * f_Tnode_Equ_B_Node_Ptr;
    double * f_Tnode_Equ_D_Node_Ptr;
    double * f_Tnode_Equ_G_Node_Ptr;
    double * f_B_Equ_Tnode_Node_Ptr;
    double * f_B_Equ_S_Node_Ptr;
    double * f_B_Equ_B_Node_Ptr;
    double * f_B_Equ_D_Node_Ptr;
    double * f_B_Equ_G_Node_Ptr;
    double * f_NSIG_Equ_D_Node_Ptr;
    double * f_NSIG_Equ_S_Node_Ptr;
    double * f_NSIG_Equ_G_Node_Ptr;
    double * f_NSIG_Equ_B_Node_Ptr;
    double * f_NSIG_Equ_Tnode_Node_Ptr;
    double * f_NSIG_Equ_NSIG_Node_Ptr;
    double * f_G_Equ_NSIG_Node_Ptr;
    double * f_S_Equ_NSIG_Node_Ptr;
    double * f_D_Equ_NSIG_Node_Ptr;
    double * f_NSIG_Equ_BRA_NSIG_GND_Var_Ptr;
    double * f_BRA_NSIG_GND_Equ_D_Node_Ptr;
    double * f_BRA_NSIG_GND_Equ_S_Node_Ptr;
    double * f_BRA_NSIG_GND_Equ_G_Node_Ptr;
    double * f_BRA_NSIG_GND_Equ_B_Node_Ptr;
    double * f_BRA_NSIG_GND_Equ_Tnode_Node_Ptr;
    double * f_BRA_NSIG_GND_Equ_NSIG_Node_Ptr;
    double * f_BRA_NSIG_GND_Equ_BRA_NSIG_GND_Var_Ptr;
    double * q_S_Equ_D_Node_Ptr;
    double * q_S_Equ_S_Node_Ptr;
    double * q_D_Equ_D_Node_Ptr;
    double * q_D_Equ_S_Node_Ptr;
    double * q_S_Equ_G_Node_Ptr;
    double * q_D_Equ_G_Node_Ptr;
    double * q_S_Equ_B_Node_Ptr;
    double * q_D_Equ_B_Node_Ptr;
    double * q_S_Equ_Tnode_Node_Ptr;
    double * q_D_Equ_Tnode_Node_Ptr;
    double * q_G_Equ_S_Node_Ptr;
    double * q_G_Equ_B_Node_Ptr;
    double * q_G_Equ_D_Node_Ptr;
    double * q_G_Equ_G_Node_Ptr;
    double * q_G_Equ_Tnode_Node_Ptr;
    double * q_Tnode_Equ_Tnode_Node_Ptr;
    double * q_Tnode_Equ_S_Node_Ptr;
    double * q_Tnode_Equ_B_Node_Ptr;
    double * q_Tnode_Equ_D_Node_Ptr;
    double * q_Tnode_Equ_G_Node_Ptr;
    double * q_B_Equ_Tnode_Node_Ptr;
    double * q_B_Equ_S_Node_Ptr;
    double * q_B_Equ_B_Node_Ptr;
    double * q_B_Equ_D_Node_Ptr;
    double * q_B_Equ_G_Node_Ptr;
    double * q_NSIG_Equ_D_Node_Ptr;
    double * q_NSIG_Equ_S_Node_Ptr;
    double * q_NSIG_Equ_G_Node_Ptr;
    double * q_NSIG_Equ_B_Node_Ptr;
    double * q_NSIG_Equ_Tnode_Node_Ptr;
    double * q_NSIG_Equ_NSIG_Node_Ptr;
    double * q_G_Equ_NSIG_Node_Ptr;
    double * q_S_Equ_NSIG_Node_Ptr;
    double * q_D_Equ_NSIG_Node_Ptr;
    double * q_NSIG_Equ_BRA_NSIG_GND_Var_Ptr;
    double * q_BRA_NSIG_GND_Equ_D_Node_Ptr;
    double * q_BRA_NSIG_GND_Equ_S_Node_Ptr;
    double * q_BRA_NSIG_GND_Equ_G_Node_Ptr;
    double * q_BRA_NSIG_GND_Equ_B_Node_Ptr;
    double * q_BRA_NSIG_GND_Equ_Tnode_Node_Ptr;
    double * q_BRA_NSIG_GND_Equ_NSIG_Node_Ptr;
    double * q_BRA_NSIG_GND_Equ_BRA_NSIG_GND_Var_Ptr;
    // Jacobian offsets
    int A_S_Equ_D_NodeOffset;
    int A_S_Equ_S_NodeOffset;
    int A_D_Equ_D_NodeOffset;
    int A_D_Equ_S_NodeOffset;
    int A_S_Equ_G_NodeOffset;
    int A_D_Equ_G_NodeOffset;
    int A_S_Equ_B_NodeOffset;
    int A_D_Equ_B_NodeOffset;
    int A_S_Equ_Tnode_NodeOffset;
    int A_D_Equ_Tnode_NodeOffset;
    int A_G_Equ_S_NodeOffset;
    int A_G_Equ_B_NodeOffset;
    int A_G_Equ_D_NodeOffset;
    int A_G_Equ_G_NodeOffset;
    int A_G_Equ_Tnode_NodeOffset;
    int A_Tnode_Equ_Tnode_NodeOffset;
    int A_Tnode_Equ_S_NodeOffset;
    int A_Tnode_Equ_B_NodeOffset;
    int A_Tnode_Equ_D_NodeOffset;
    int A_Tnode_Equ_G_NodeOffset;
    int A_B_Equ_Tnode_NodeOffset;
    int A_B_Equ_S_NodeOffset;
    int A_B_Equ_B_NodeOffset;
    int A_B_Equ_D_NodeOffset;
    int A_B_Equ_G_NodeOffset;
    int A_NSIG_Equ_D_NodeOffset;
    int A_NSIG_Equ_S_NodeOffset;
    int A_NSIG_Equ_G_NodeOffset;
    int A_NSIG_Equ_B_NodeOffset;
    int A_NSIG_Equ_Tnode_NodeOffset;
    int A_NSIG_Equ_NSIG_NodeOffset;
    int A_G_Equ_NSIG_NodeOffset;
    int A_S_Equ_NSIG_NodeOffset;
    int A_D_Equ_NSIG_NodeOffset;
    int A_NSIG_Equ_BRA_NSIG_GND_Var_Offset;
    int A_BRA_NSIG_GND_Equ_D_Node_Offset;
    int A_BRA_NSIG_GND_Equ_S_Node_Offset;
    int A_BRA_NSIG_GND_Equ_G_Node_Offset;
    int A_BRA_NSIG_GND_Equ_B_Node_Offset;
    int A_BRA_NSIG_GND_Equ_Tnode_Node_Offset;
    int A_BRA_NSIG_GND_Equ_NSIG_Node_Offset;
    int A_BRA_NSIG_GND_Equ_BRA_NSIG_GND_Var_Offset;
    // end of Jacobian and pointers
   // node numbers
    static const int admsNodeID_D = 0;
    static const int admsNodeID_G = 1;
    static const int admsNodeID_S = 2;
    static const int admsNodeID_B = 3;
    static const int admsNodeID_Tnode = 4;
    static const int admsNodeID_NSIG = 0+5;
    static const int admsNodeID_GND = -1;
   // end node numbers
   // Additional IDs for branch equations
    static const int admsBRA_ID_NSIG_GND = 6;
   // end branch numbers
   // Probe numbers
    static const int admsProbeID_V_D_GND = 0;
    static const int admsProbeID_V_S_GND = 1;
    static const int admsProbeID_V_B_GND = 2;
    static const int admsProbeID_V_G_GND = 3;
    static const int admsProbeID_I_NSIG_GND = 4;
    static const int admsProbeID_V_NSIG_GND = 5;
    static const int admsProbeID_Temp_Tnode_GND = 6;
    static const int admsProbeID_V_S_B = 7;
    static const int admsProbeID_V_D_S = 8;
    static const int admsProbeID_V_G_S = 9;
   // end probe numbers
   // Store LIDs
   // end store LIDs
   // Store LIDs for output vars
    int li_store_type;
    int li_store_vds;
    int li_store_vsb;
    int li_store_vgs;
    int li_store_vth;
    int li_store_vth_drive;
    int li_store_vdsat;
    int li_store_vdsat_marg;
    int li_store_id;
    int li_store_ig;
    int li_store_is;
    int li_store_ib;
    int li_store_ids;
    int li_store_igidl;
    int li_store_igisl;
    int li_store_igs;
    int li_store_igd;
    int li_store_idb;
    int li_store_isb;
    int li_store_gm;
    int li_store_gmb;
    int li_store_gds;
    int li_store_cgg;
    int li_store_cgd;
    int li_store_cgs;
    int li_store_cgb;
    int li_store_cdd;
    int li_store_cdg;
    int li_store_cds;
    int li_store_cdb;
    int li_store_cbb;
    int li_store_cbg;
    int li_store_cbs;
    int li_store_cbd;
    int li_store_css;
    int li_store_csg;
    int li_store_csb;
    int li_store_csd;
    int li_store_tk;
    int li_store_dtsh;
    int li_store_self_gain;
    int li_store_rout;
    int li_store_beff;
    int li_store_ft;
    int li_store_rgate;
    int li_store_gmoverid;
    int li_store_vearly;
   // end store LIDs for output vars
 // Arrays to hold probes
 std::vector < double > probeVars;
 std::vector < std::vector < double > > d_probeVars;
 // Arrays to hold contributions
 // dynamic contributions are differentiated w.r.t time
 std::vector < double > staticContributions;
 std::vector < std::vector < double > > d_staticContributions;
 std::vector < double > dynamicContributions;
 std::vector < std::vector < double > > d_dynamicContributions;
//vectors to hold noise information for communication between methods
std::vector<double> noiseContribsPower;
std::vector<double> noiseContribsExponent;


    // this is what we'll use when any model uses $temperature.  We'll
    // set it in updateTemperature, and initialize it to whatever
    // is in devOptions when the instance is constructed.
    double admsTemperature;

    // vt at $temperature;
    double adms_vt_nom;


    // This one is for the annoying bogus "XyceADMSInstTemp" parameter
    // that we need so we can set it from the device manager when there's no
    // "TEMP" parameter to use
    double admsInstTemp;


    static JacobianStamp jacStamp;
    static IdVector nodeMap;
    static PairMap pairToJacStampMap;

    // These instance-owned vectors are for storage of lead current data
    std::vector<double> leadCurrentF;
    std::vector<double> leadCurrentQ;


    };


//-----------------------------------------------------------------------------
// Class         : Model

// Purpose       :
// Special Notes :
// Creator       :
// Creation Date :
//-----------------------------------------------------------------------------
class Model : public DeviceModel
{
    typedef std::vector<Instance *> InstanceVector;

    friend class ParametricData<Model>;
    friend class Instance;
#ifdef Xyce_ADMS_SENSITIVITIES
    friend class InstanceSensitivity;
    friend class ModelSensitivity;
#endif // Xyce_ADMS_SENSITIVITIES
    friend struct Traits;

  public:
    Model(
      const Configuration &       configuration,
      const ModelBlock &          model_block,
      const FactoryBlock &        factory_block);

    ~Model();

private:
    Model(const Model &);
    Model &operator=(const Model &);

public:
    virtual void forEachInstance(DeviceInstanceOp &op) const /* override */;
    virtual std::ostream &printOutInstances(std::ostream &os) const;
    bool processParams();
    bool processInstanceParams();

  private:

  public:
    void addInstance(Instance *instance)
    {
      instanceContainer.push_back(instance);
    }

    void setupBaseInstanceContainer()
    {
      std::vector<Instance*>::iterator iter = instanceContainer.begin();
      std::vector<Instance*>::iterator end   = instanceContainer.end();
      for ( ; iter!=end; ++iter)
      {
      Xyce::Device::DeviceModel::baseInstanceContainer.push_back( static_cast<Xyce::Device::DeviceInstance *>(*iter) );
    }
  }

  private:
    std::vector<Instance*> instanceContainer;

  private:

    // This one is for the annoying bogus "XyceADMSInstTemp" parameter
    // that we need so we can set it from the device manager when there's no
    // "TEMP" model parameter to use
    double admsModTemp;
// Begin verilog Model Variables
//   Model Parameters
    int SWSCALE;
    double VERSION;
    int SWSUBDEP;
    int SWIGATE;
    int SWGIDL;
    int SWSHE;
    int SWIGN;
    int SWJUNASYM;
    int SWIMPACT;
    double QMC;
    int TYPE;
    double TR;
    double TMAX;
    double TOXE;
    double TSI;
    double XGE;
    double TBOX;
    double NCH;
    double NSUB;
    double CT;
    double TOXP;
    double NOV;
    double NOVD;
    double VFB;
    double VFBB;
    double STVFB;
    double CICF;
    double CIC;
    double PSCE;
    double PSCEB;
    double NSDDC;
    double PSCEDLB;
    double PNCE;
    double CF;
    double CFB;
    double STCF;
    double CFD;
    double CFDL;
    double CFDLB;
    double BETN;
    double BETNB;
    double STBET;
    double CS;
    double CSFI;
    double CSBI;
    double STCS;
    double THECS;
    double STTHECS;
    double CSTHR;
    double CSTHRB;
    double MUE;
    double STMUE;
    double THEMU;
    double STTHEMU;
    double XCOR;
    double XCORB;
    double STXCOR;
    double FETA;
    double RS;
    double RSIG;
    double STRS;
    double RSG;
    double THERSG;
    double RSB;
    double THESAT;
    double STTHESAT;
    double THESATG;
    double THESATB;
    double AX;
    double ALP;
    double ALP1;
    double ALPB;
    double VP;
    double VPG;
    double GCO;
    double IGINV;
    double IGOVINV;
    double IGOVINVD;
    double IGOVACC;
    double IGOVACCD;
    double STIG;
    double GC2CH;
    double GC3CH;
    double GC2OVINV;
    double GC3OVINV;
    double GC2OVACC;
    double GC3OVACC;
    double GCDOV;
    double GCVDOV;
    double CHIB;
    double NIGINV;
    double FNOVINV;
    double FNOVINVD;
    double GCOVINVFN;
    double STIGFN;
    double AGIDL;
    double AGIDLD;
    double BGIDL;
    double BGIDLD;
    double STBGIDL;
    double STBGIDLD;
    double CGIDL;
    double CGIDLD;
    double DGIDL;
    double DGIDLD;
    double A1;
    double A2;
    double STA2;
    double A3;
    double AREAQ;
    double CGBOV;
    double NSDAC;
    double FIF;
    double FSCEAC;
    double COV;
    double COVD;
    double COVDL;
    double COVDLB;
    double DVFBOV;
    double CFR;
    double CFRD;
    double CSD;
    double CSDBP;
    double RTH;
    double STRTH;
    double CTH;
    double FNT;
    double FNTEXC;
    double NFA;
    double NFB;
    double NFC;
    double NFE;
    double NFEB;
    double EF;
    double LVARO;
    double LVARL;
    double LVARW;
    double LAP;
    double WVARO;
    double WVARL;
    double WVARW;
    double WOT;
    double DLQ;
    double DWQ;
    double TOXEO;
    double TSIO;
    double XGEO;
    double TBOXO;
    double NCHO;
    double NSUBO;
    double CTO;
    double TOXPO;
    double NOVO;
    double NOVDO;
    double VFBO;
    double VFBL;
    double VFBLEXP;
    double VFBL2;
    double VFBLEXP2;
    double VFBW;
    double VFBLW;
    double VFBBO;
    double VFBLBO;
    double STVFBO;
    double STVFBL;
    double STVFBW;
    double STVFBLW;
    double CICFO;
    double CICO;
    double PSCEL;
    double PSCELEXP;
    double PSCEW;
    double PSCEBO;
    double NSDDCO;
    double PSCEDLBO;
    double PNCEW;
    double CFL;
    double CFLEXP;
    double CFW;
    double CFBO;
    double STCFL;
    double CFDO;
    double CFDLL;
    double CFDLW;
    double CFDLBO;
    double UO;
    double FBET1;
    double FBET1W;
    double LP1;
    double LP1W;
    double FBET2;
    double LP2;
    double BETW1;
    double BETW2;
    double WBET;
    double BETNBO;
    double STBETO;
    double STBETL;
    double STBETW;
    double STBETLW;
    double CSO;
    double CSL;
    double CSLEXP;
    double CSW;
    double CSLW;
    double CSFIO;
    double CSBIO;
    double STCSO;
    double STCSL;
    double STCSW;
    double STCSLW;
    double THECSO;
    double STTHECSO;
    double CSTHRO;
    double CSTHRBO;
    double MUEO;
    double STMUEO;
    double THEMUO;
    double STTHEMUO;
    double XCORO;
    double XCORL;
    double XCORLEXP;
    double XCORW;
    double XCORLW;
    double XCORBO;
    double STXCORO;
    double FETAO;
    double RSW1;
    double RSW2;
    double RSIGO;
    double STRSO;
    double RSGO;
    double THERSGO;
    double RSBO;
    double THESATO;
    double THESATL;
    double THESATLEXP;
    double THESATW;
    double THESATLW;
    double STTHESATO;
    double STTHESATL;
    double STTHESATW;
    double STTHESATLW;
    double THESATGO;
    double THESATBO;
    double AXO;
    double AXL;
    double AXLEXP;
    double AXL2;
    double AXLEXP2;
    double ALPL1;
    double ALPLEXP;
    double ALPL2;
    double ALPLEXP2;
    double ALPW;
    double ALP1L1;
    double ALP1LEXP;
    double ALP1L2;
    double ALP1LEXP2;
    double ALP1W;
    double ALPBO;
    double VPO;
    double VPGO;
    double GCOO;
    double IGINVLW;
    double IGOVINVW;
    double IGOVINVDW;
    double IGOVACCW;
    double IGOVACCDW;
    double STIGO;
    double GC2CHO;
    double GC3CHO;
    double GC2OVINVO;
    double GC3OVINVO;
    double GC2OVACCO;
    double GC3OVACCO;
    double GCDOVL;
    double GCVDOVO;
    double CHIBO;
    double NIGINVO;
    double FNOVINVW;
    double FNOVINVDW;
    double GCOVINVFNO;
    double STIGFNO;
    double AGIDLO;
    double AGIDLDO;
    double AGIDLW;
    double AGIDLDW;
    double BGIDLO;
    double BGIDLDO;
    double STBGIDLO;
    double STBGIDLDO;
    double CGIDLO;
    double CGIDLDO;
    double DGIDLO;
    double DGIDLDO;
    double DGIDLL;
    double DGIDLDL;
    double A1O;
    double A1L;
    double A1W;
    double A2O;
    double STA2O;
    double A3O;
    double A3L;
    double A3W;
    double CGBOVO;
    double CGBOVL;
    double NSDACO;
    double FIFW;
    double FSCEACO;
    double LOVO;
    double LOVDO;
    double COVDLO;
    double COVDLW;
    double COVDLBO;
    double DVFBOVO;
    double CFRO;
    double CFRDO;
    double CFRW;
    double CFRDW;
    double CSDO;
    double CSDBPO;
    double RTHO;
    double RTHL;
    double RTHW;
    double RTHLW;
    double STRTHO;
    double CTHO;
    double LAMBTHO;
    double FTHO;
    double FNTO;
    double FNTEXCL;
    double FNTEXCLEXP;
    double NFALW;
    double NFAW;
    double NFBLW;
    double NFCLW;
    double NFEO;
    double NFEBO;
    double EFO;
    int SWSTRESS;
    double SAREF;
    double SBREF;
    double WLOD;
    double KUO;
    double KVSAT;
    double TKUO;
    double LKUO;
    double WKUO;
    double PKUO;
    double LLODKUO;
    double WLODKUO;
    double KVTHO;
    double LKVTHO;
    double WKVTHO;
    double PKVTHO;
    double LLODVTH;
    double WLODVTH;
    double STETAO;
    double LODETAO;
    double STRLAMBDA;
    double STRALPHA;
    double STRDVFBO;
    double STRWDVFBO;
    double STRDCFL;
    double STRRUO;
    double STRTRUO;
    double STRRVSAT;
    //  Variables of global_model scope
    int SWSHE_i;
    double TKR;
    double TKD;
    double gmin;
    // end verilog model variables=====
};

void registerDevice(const DeviceCountMap& deviceMap = DeviceCountMap(),
                    const std::set<int>& levelSet = std::set<int>());

} // namespace ADMSl_utsoi
} // namespace Device
} // namespace Xyce
#endif //Xyce_N_DEV_ADMSl_utsoi_h
